Warm tip: This article is reproduced from serverfault.com, please click

subscribers in wordpress users and in external platform

发布于 2020-12-07 18:28:03

is it possible for a wordpress subscription form to add subscribers in the wordpress user list and, at the same time, in a list on an external platform, such as mailchimp or activecampaign?

many thanks

Questioner
kaqu
Viewed
0
Fresz 2020-12-08 02:37:26

It is possible to do it. However, you need to take into consideration the GDPR laws (and similar around the world). It is illegal to collect user data without consent.

In WordPress you need to use user_register hook - which will fire right after user registers. The hook passes user ID and from there you can get the email address and subscribe the user to a mailing list via API call.

add_action('user_register','my_function');

function my_function($user_id){
  //do your stuff
}

Reference for MailChimp API: https://mailchimp.com/developer/guides/create-your-first-audience/