dev-master
9999999-dev http://www.atomicsmash.co.uk/Ultimate Mailchimp Plugin
MIT
The Requires
by Atomic Smash
by David Darke
plugin wordpress mailchimp dev
Ultimate Mailchimp Plugin
On almost all of the WordPress sites that Atomic Smash create and maintain, we do some form of MailChimp syncing. Most existing plugins rely on the need to record information within WP to then sync with MailChimp at a later point., (*1)
We found this can become very cumbersome. List members are able to interact with MailChimp outside of the website via the list communication preferences (or even by just unsubscribing from the list). This boils down to a member being able to change there details without your WP site being involved. Of course, you can setup webhooks to notify your site when a change is made via MailChimp blah blah blah... BUT... Just keep it simple. Maintain MailChimp as the 'single source of truth' and forgot about needing to keep subscription preferences in line with the WP site., (*2)
Thanks to this separation, WordPress and MailChimp are completable replaceable in the future., (*3)
If you need to move to a new CMS, everything is inside MailChimp already., (*4)
If you need to move away from MailChimp, just export from MailChimp. There are no user artefacts within your Wordpress site regarding user communication preferences., (*5)
This plugin communicates with MailChimp at these points:, (*6)
woocommerce_checkout_update_order_meta
More points of interaction will be added in the future., (*7)
Know of another time you would like to talk to MailChimp? Please add an issue! ๐, (*8)
Users will be shown a description of what MailChimp does as a marketing platform, then .. CHECKBOX OPTIONS, (*9)
All of this text in editable via the available via these filters. ๐, (*10)
Run this in the root of your project:, (*11)
composer require atomicsmash/ultimate-mailchimp-plugin
Add these config details to your wp-config.php
, (*12)
define('ULTIMATE_MAILCHIMP_LIST_ID', ''); define('ULTIMATE_MAILCHIMP_API_KEY', ''); define('ULTIMATE_MAILCHIMP_GDPR_FIELDS', true);
ULTIMATE_MAILCHIMP_LIST_ID
- This is the list you would sync with. This can be found here., (*13)
ULTIMATE_MAILCHIMP_API_KEY
- This is your key can be found in your account., (*14)
ULTIMATE_MAILCHIMP_GDPR_FIELDS
-, (*15)
By default, when someone checks the "Sign me up to the MailChimp newsletter", the subscriber status is set to 'pending'. This will trigger a confirmation email from MailChimp., (*16)
To make sure this functionality is active, go to your primary list > Settings > 'List name and campaign' and check the "Enable double opt-in" checkbox and save. , (*17)
MailChimp have added a series of 'marketing permission' (GDPR) fields to it's API. To be able to interact with these, we need a few pieces of information., (*18)
Here are some extra config options. We would recommend only using these in a development or testing environment., (*19)
define('ULTIMATE_MAILCHIMP_LOGGING', true); define('ULTIMATE_MAILCHIMP_DEBUG', true);
ULTIMATE_MAILCHIMP_LOGGING
- This enables logging to the file: wp-content/uploads/ultimate-mailchimp.log
via monolog., (*20)
ULTIMATE_MAILCHIMP_DEBUG
- When in debug mode, WooCommerce checkout will not complete (There will be a JSON error) yet MailChimp will be called. This allows you to run through the checkout process without having to create a new order each time., (*21)
ULTIMATE_MAILCHIMP_DOUBLE_OPTIN
- If you would like to disable the double opt-in and force the new users to be subscribed by default on sync, add this constant to your config and set to false
., (*22)
These merge fields are sent by default are:, (*23)
**FNAME** - This is taken from the first name in the billing details. **LNAME** - This is taken from the last name in the billing details.
To edit the merge fields sent to MailChimp, use the merge field filter here., (*24)
View filters here, (*25)
user_register
: This is a global hook that is fired when a user is created inside WordPress. This means it's fired from the frontend registration form, backend user addition screen, any plugin or custom script used to register users and almost anything in between.Ultimate Mailchimp Plugin
MIT
plugin wordpress mailchimp dev