=== Paid Memberships Pro - Mailchimp Add On ===
Contributors: strangerstudios, dlparker1005, paidmembershipspro
Tags: paid memberships pro, pmpro, mailchimp, email marketing
Requires at least: 5.4
Tested up to: 6.6
Stable tag: 2.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Add users and members to Mailchimp audiences based on their membership level and allow members to opt-in to specific audiences.
== Description ==
Subscribe WordPress users and members to your Mailchimp audiences.
This plugin offers extended functionality for [membership websites using the Paid Memberships Pro plugin](https://www.paidmembershipspro.com) available for free in the WordPress plugin repository.
With Paid Memberships Pro installed, you can specify unique audiences for each membership level, as well as opt-in audiences that a member can join as part of checkout or by editing their user profile. By default, the integration will merge the user's email address and membership level information. You can send additional user profile details to Mailchimp [using the method described here](https://www.paidmembershipspro.com/send-additional-user-information-fields-mailchimp/).
The settings page allows the site admin to specify which audience lists to assign users and members to plus additional features you may wish to adjust. The first step is to connect your website to Mailchimp using your account's API Key. Here's how to find the API key in Mailchimp:
https://www.youtube.com/watch?v=ctcy1_npmRE
= Additional Settings =
* **Non-member Audiences:** These are the audiences that users will be added to if they do not have a membership level. 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. Audiences set as Opt-in Audiences should not also be set as a Non-member Audience nor a Level Audience.
* **Require Double Opt-in?:** If set to “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?:** If set to “No”, users will not be automatically unsubscribed from any audiences when they lose a membership level. If set to “Yes (Only old level audiences.)”, users will be unsubscribed from any level audiences they are subscribed to when they lose that level, assuming that audience is not a Non-Member audience as well. If set to “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:** If set to “Yes”, PMPro will update Mailchimp audiences whenever a user’s profile page is saved. If set to “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?:** If set to “Yes”, API calls to Mailchimp will be logged in the `/pmpro-mailchimp/logs` folder.
* **Membership Levels and Audiences:** These are the audiences that users will automatically be subscribed to when they receive a membership level.
== Installation ==
This plugin works with and without Paid Memberships Pro installed.
= Download, Install and Activate! =
1. Upload the `pmpro-mailchimp` directory to the `/wp-content/plugins/` directory of your site.
1. Activate the plugin through the 'Plugins' menu in WordPress.
1. Navigate to Settings > PMPro Mailchimp to proceed with setup.
= Configuration and Settings =
**Enter your Mailchimp API Key:** Your Mailchimp API key can be found within your Mailchimp account under Account > Extras > API keys. If you don't have a Mailchimp account, [you can create one here](http://eepurl.com/k4aAH). Read our documentation for a [video demonstrating how to locate your Mailchimp API key](https://www.paidmembershipspro.com/add-ons/pmpro-mailchimp-integration/#api-key).
After entering your API Key, continue with the setup by assigning User or Member Audiences and reviewing the additional settings.
For full documentation on all settings, please visit the [Mailchimp Integration Add On documentation page at Paid Memberships Pro](https://www.paidmembershipspro.com/add-ons/pmpro-mailchimp-integration/).
Several action and filter hooks are available for developers that need to customize specific aspects of the integration. [Please explore the plugin's action and filter hooks here](https://www.paidmembershipspro.com/add-ons/pmpro-mailchimp-integration/#hooks).
== Frequently Asked Questions ==
= I found a bug in the plugin. =
Please post it in the issues section of GitHub and we'll fix it as soon as we can. Thanks for helping. [https://github.com/strangerstudios/pmpro-mailchimp/issues](https://github.com/strangerstudios/pmpro-mailchimp/issues)
= I need help installing, configuring, or customizing the plugin. =
Please visit [our support site at https://www.paidmembershipspro.com](https://www.paidmembershipspro.com/) for more documentation and our support forums.
== Screenshots ==
1. General Settings for plugin, including the non-member audiences opt-in rules, and unsubscribe rules.
2. Specific settings for Membership Levels and Audiences.
== Changelog ==
= 2.4 - 2024-10-17 =
* FEATURE: Now updating the plugin from paidmembershipspro.com.
* ENHANCEMENT: Updated translation files bundled with the plugin.
= 2.3.7 - 2024-09-24 =
* ENHANCEMENT: Updated UI for compatibility with PMPro v3.1. #145 (@andrewlimaza, @kimcoleman)
* BUG FIX: Fixed over-escaping in settings. #144 (@dparker1005)
* BUG FIX: Fixed issue with exporting CSV of members for Mailchimp Import. #139 (@dparker1005)
* BUG FIX: Fixed warning when site admin enters an improperly formatted Mailchimp API Key. #146 (@kimcoleman)
= 2.3.6 - 2024-03-27 =
* SECURITY: Now preparing SQL statements.
* SECURITY: Improved escaping of strings.
* ENHANCEMENT: Added translator comments for placeholders.
= 2.3.5 - 2024-03-08 =
* SECURITY: Now adding a randomized suffix to the log file name to prevent unauthorized access. #138 (@dparker1005)
* SECURITY: Now preventing access to the `/log/` directory listing. #138 (@dparker1005)
* ENHANCEMENT: Added a filter `pmpromc_update_audience_members_data` to allow modifying data sent to the `/lists/{$audience}` Mailchimp endpoint. #137 (@efc)
= 2.3.4 - 2023-11-15 =
* SECURITY: Now obfuscating email domains in debug logs. #135 (@andrewlimaza)
* ENHANCEMENT: Updating `
` tags to `
` tags for better accessibility. #133 (@kimwhite)
* REFACTOR: No longer pulling the checkout level from the `$_REQUEST` variable. #132 (@dparker1005)
= 2.3.3 - 2023-03-01 =
* ENHANCEMENT: Improved formatting of opt-in audience section on checkout page. (@mircobabini)
* ENHANCEMENT: Added filter `pmpromc_log_path` to allow changing the path where API calls are logged. (@JarrydLong)
* BUG FIX/ENHANCEMENT: Now using `readfile()` during CSV export if `fpassthru()` is not available. (@JarrydLong)
* REFACTOR: Marking the `set_user_interest()` method as deprecated. (@dparker1005)
= 2.3.2 - 2021-03-02 =
* ENHANCEMENT: Added setting to log API calls sent to Mailchimp in the `pmpro-mailchimp/logs` folder.
* ENHANCEMENT: Added a pmpromc_user_data filter to filter user data taht is sent to Mailchimp.
* ENHANCEMENT: Audience checkboxes are now shown as scrollable list on settings page if there are more than 5.
* BUG FIX/ENHANCEMENT: Added CSS class for checkbox labels.
* BUG FIX/ENHANCEMENT: Now passing a valid user object when generating CSV export file headers.
* BUG FIX: Fixed undefined variable in pmpromc_user_register() (Thanks, x140l31 on GitHub).
* BUG FIX: Fixed required parameter being included after optional parameters in add_merge_field().
* BUG FIX: Fixed URL to PMPro support page (Thanks, majerus1223 on GitHub).
= 2.3.1 - 2020-04-28 =
* ENHANCEMENT: Added support for Paid Memberships Pro v2.3+ front-end profile edit page.
* ENHANCEMENT: Now using checkboxes to select audiences instead of