Set up a free or paid newsletter with Mailchimp and Paid Memberships Pro. This plugin connects membership checkouts directly to Mailchimp and adds members to specific audiences based on their membership level.
Streamline your communication efforts, enhance member engagement, and drive retention with targeted, level-specific campaigns. The main features of this Mailchimp integration include:
- Automatically add members to Mailchimp audiences based on membership level.
- Set up opt-in lists, so members can choose to receive additional communications from you at checkout or by editing their member profile.
- Send the membership level and any additional custom user fields to Mailchimp, such as a member’s location, phone number, and more.
- Easy to use admin settings define which audiences are assigned per membership level.
The integration requires a Mailchimp account, so if you do not have an account you can sign up here.
Installation
You must have the Paid Memberships Pro plugin installed and activated to use this Add On.
- Navigate to Memberships > Add Ons in the WordPress admin.
- Locate the Add On and click “Install Now“.
- Or, to install this plugin manually, download the .zip file above.
- Upload the compressed directory (.zip) via the Plugins > Add New > Upload Plugin screen in the WordPress admin.
- Activate the plugin through the Plugins screen in the WordPress admin.
Video Demo
Settings
Navigate to Settings > PMPro Mailchimp in the WordPress admin to configure the plugin for your site. Below is a description of the various settings available in the plugin.
General Settings
- Mailchimp API Key: Used to connect your website to Mailchimp. Follow the instructions in the Locating your Mailchimp API Key section below for help finding this information.
- Non-member Audiences: Users who do not have a membership level will be added to these audiences. They will also be removed from these audiences when they gain a membership level (assuming the audiences are not also set in the “Membership Levels and Audiences” option for their new level)
- Opt-in Audiences: These are the audiences that users will have the option to subscribe to during the PMPro checkout process. Users are later able to update their choice from their profile. You should not set Opt-in Audiences as either Non-member Audiences or Level Audiences.
- Require Double Opt-in?:
- “Yes (All audiences)” – Users will be set to “Pending” status in Mailchimp when they are added to an audience instead of being subscribed right away. They will then receive an email from Mailchimp to opt-in to the audience.
- Unsubscribe on Level Change?:
- “No” – Users will not be automatically unsubscribed from any audiences when they lose a membership level.
- “Yes (Only old level audiences.)” – When users lose a level, they will be unsubscribed from any corresponding Level Audiences, unless those audiences are also Non-Member Audiences.
- “Yes (Old level and opt-in audiences.)” – Users will also be unsubscribed from opt-in audiences when they lose their membership level (though they can re-subscribe by updating the setting on their profile).
- Update on Profile Save
- “Yes” – PMPro will update Mailchimp audiences whenever a user’s profile page is saved.
- “No” – PMPro will only update Mailchimp when a user’s membership level is changed, email is changed, or chosen opt-in audiences are changed.
- Log API Calls
- “Yes” – A log of API calls will be created in the
pmpro-mailchimp/logs
folder.
- “Yes” – A log of API calls will be created in the
Membership Levels and Audiences
For each membership level in your site, you can use these settings to add specific audiences that users will automatically subscribe to when they receive a membership level.
Notes About Logging API Calls
If members are not being properly added to Mailchimp or you are unsure about your integration’s configuration, you can temporarily enable the Log API Calls setting. This option is available under Settings > PMPro Mailchimp in the WordPress admin.
When you enable this setting, the plugin will store a file on your server with information about the data that this integration is sending to Mailchimp.
This file contains partial email addresses of your subscribers, their name (if collected), membership level, and other custom information you may be collecting via custom filters.
To prevent bad actors from discovering this file, the file will have a random name. But, even with the protection of an obfuscated file URL and scrubbed email data, we strongly recommend that you only leave the Log API Calls setting enabled while you are actively resolving issues with the integration.
When you are done resolving issues and confident that your site is working properly, disable debug the Log API Call setting and delete the log file (via S/FTP) that was created.
Locating Your Mailchimp API Key
- Log in to your account at Mailchimp.
- Click your profile name in the upper right corner to expand the menu and choose Profile.
- Click the Extras dropdown menu and choose API keys.
- Click the Create A Key button.
- Name your key so you will know what application uses that key.
- Copy and paste your Mailchimp API key into the “Mailchimp API Key” field under Settings > PMPro Mailchimp.
Video: How to Locate Your Mailchimp API Key
Action and Filter Hooks
Below are the common action and filter hooks.
apply_filters( 'pmpro_mailchimp_merge_fields', array $merge_fields, string $audience_id );
Creates merge fields inside Mailchimp. Should be done for any fields that are added with pmpro_mailchimp_listsubscribe_fields
so that the fields are automatically created.
apply_filters( 'pmpro_mailchimp_listsubscribe_fields', array $merge_fields, WP_User $user, string $audience );
Send additional merge fields to Mailchimp. This article demonstrates how to use the ‘pmpro_mailchimp_listsubscribe_fields’ filter to send additional profile fields to Mailchimp.
apply_filters( 'pmpromc_user_data' , $mc_user_data, $user );
apply_filters( 'pmpromc_disable_automatic_additional_audiences_updates', bool $disabled );
Stops Mailchimp from updating subscription status for opt-in lists automatically. Disabling may help site performance.
apply_filters( 'pmpromc_profile_update', bool $update, int $user_id, WP_User $old_user );
Overwrites the “Update on Level Save” setting. In the future, we will remove this filter in favor of the setting. The filter is in many existing code recipes.
pmpromc_update_audience_members_data
Allows modifying data sent to the /lists/{$audience}
Mailchimp endpoint
CSV Export Filters
The two filters below are part of core Paid Memberships Pro and are within the Mailchimp Add On for export-related adjustments.
apply_filters( 'pmpro_set_max_user_per_export_loop', int $max_users );
Sets max number of users exported at a time during CSV export. For information on this filter, see: https://www.paidmembershipspro.com/hook/pmpro_set_max_user_per_export_loop/
apply_filters( 'pmpro_memberslist_csv_dateformat', string $format );
Sets date format used during CSV export. For information on this filter, see: https://www.paidmembershipspro.com/hook/pmpro_memberslist_csv_dateformat/
Rarely Used Action and Filter Hooks
The Mailchimp Add On for Paid Memberships Pro includes the action and filter hooks below, but they are mainly for internal functions. It is unlikely that you will need to leverage this hooks.
apply_filters( 'pmpro_addon_mc_api_timeout', int $timeout );
apply_filters( 'pmpro_addon_api_timeout', int $timeout );
apply_filters( 'pmpro_addon_mc_api_fetch_list_limit', int $limit );
apply_filters( 'get_mailchimpapi_class_instance', PMPromc_Mailchimp_API $api );
do_action( 'pmpromc_get_api_failed', PMPromc_Mailchimp_API $api );
Screenshots
This is a Free Add On.
Create a free account or log in to gain access to downloads and documentation.