Mailchimp
Subscribe your customers to a Mailchimp audience (list) when they make a purchase. Supports double opt-in and flexible templates.
Built by Digital Penguin for modmore.
Usage
- Download and install Mailchimp for Commerce from the modmore package provider (Note the "Mailchimp API for Commerce" from modx.com is a different package, with a different purpose.)
- Go to Extras > Commerce > Configuration > Modules, open Mailchimp from the list, end enter the api key on the module configuration. Save, then you can select the list and other options (address type, double opt-in) that are available only after adding your api key.
- Add the required markup to one of your checkout templates and start accepting new subscriptions.
Ask your customers if they want to subscribe to your mailing list using the following markup:
{% if mailchimp_enabled and not mailchimp_subscribed %}
<label class="c-subscribe-newsletter">
<input type="checkbox" name="mailchimp_opt_in" value="on">
{{ lex('commerce_mailchimp.subscribe_to_newsletter') }}
</label>
{% endif %}
This code makes sure that the checkbox only shows up when the module is enabled and properly configured, and when the customer is not already subscribed to the list.
You can change the markup to suit your need. The module requires the value "on
" for a field named "mailchimp_opt_in
", but you can present it any way you'd like.
The field can be added to the cart, address, or payment method step, corresponding to these templates:
- frontend/checkout/cart.twig
- frontend/checkout/address.twig
- frontend/checkout/payment-method.twig
Regardless of in what step the customer is asked to opt-in, they will be added to the list when the order is completed.
Releases
Mailchimp for Commerce 1.0.3-pl
Released on 2021-06-21
Released on 2021-06-21
- Fix PHP warning: Undefined array key "mailchimp_opt_in"
Mailchimp for Commerce 1.0.2-pl
Released on 2020-05-18
Released on 2020-05-18
- Fix missing lexicon when customer is not subscribed
Mailchimp for Commerce 1.0.1-pl
Released on 2019-12-13
Released on 2019-12-13
- Fix broken installation
Mailchimp for Commerce 1.0.0-pl
Released on 2019-12-13
- First release
- Read more:
- Klarna
- Lob Address Verification
- Mailchimp
- Mailchimp API
- MessageBird