Auto Subscribe WC or WP Registered user to Sendy list. Updated.
Updated contribution.
I found Pross' work here https://sendy.co/forum/discussion/7501/auto-subscribe-on-wordpress-registration#Item_2
It won't work with current Sendy because there is not API key in pross' code since it was for a older Sendy version.
I have added the needed code to:
Have api key, firstname, and a customer role filter list.
If new account doesn't have the first_name filled in pull it from the registration POST.
WP "user_register " does not write out to the database until after registration is complete.
This code is for WC Customers, but could easily switch to WP Subscribers. We are assuming they bought products or created an account in WC.
We dont bypass double opt in or set gdpr. That could be added as needed.
The updated Gist is here: https://gist.github.com/bdacus01/84171d9454e7ab4152be2edc65855c21
Thanks
bdacus01
the regular guy