How to Get MailChimp Auto Subscription upon User Registration

The most popular email marketing platform MailChimp provides many useful features to perform marketing campaigns and send newsletters by creating subscribers’ list. In this article, we will describe the method of auto subscription upon user registration for a WordPress website.

Action hooks are provided by WordPress to attach a custom function with wp functions and then WordPress perform tasks on different actions. For user registration action, user_register hook provided by WordPress has been used. You need to attach the pt_mailchimp_subscribe function with user_register hook. This will send a subscription request to MailChimp upon successful registration of the user.

pt_mailchimp_subscribe function requires a User ID sent by action hook on its call inside wp_insert_user function. You need to get MailChimp API Key and Subscribers List ID to enter in pt_mailchimp_subscribe function’s code.

Now, add the following code in Theme‘s functions.php file or you can use it for any custom plugin:

User Comments

1 thought on “How to Get MailChimp Auto Subscription upon User Registration

    Guilherme Rezende says:

    Hello! Thank you for that!

    The e-mail is subscribing very well, but the first name and last name is not going to the mailchimp list. Could you help me with that? Thank you!



Leave a Reply

Your email address will not be published. Required fields are marked *

    Get in Touch