From GroupScript documentation
- First you need to create an account on MailChimp site.
- To send emails you need a list that contains all your subscribers.
MailChimp API does not allow automatic list creation, so you will have to do it manually.
- Go to lists => create list.
- If asked "lists or groups?" - press again - "create list".
- In list creation dialog enter your list data.
- Be sure to uncheck "people can pick email format (HTML, plain-text, or mobile)", because GroupScript will send html emails only.
This is important - if you skip these steps your subscribers will receive global campaigns ONLY.
- Go to <your list> => settings => fields and merge tags.
- In next dialog press "add a field".
- Choose "text".
- For this new field enter "City" (without quotes) in "field name" and "CITY" (without quotes) in "Stick this tag in your content" text fields.
- Press "save" when done.
- If you did everything correctly, your fields and merge tags should look like this. (image on the right side)
- This is all you need to do on MailChimp side, now you need to configure GroupScript side.
- First go to backend => settings => reload options.
- Then settings => newsletter options.
- Newsletter settings => active newsletter backend - select "MailChimp" if not selected already. Press "save".
- Then Newsletter settings => newsletter mailchimp.
- Your MailChimp API key can be found in your MailChimp profile.
- Go to Account => API keys & info.
- If there are no keys - you need to create one - press "add a key".
- Now copy and paste your API key to GroupScript settings.
List id and sync interval
- You can also change how often your subscriber list will be synchronized to MailChimp (to update changed cities) - change value of mailchimp sync interval.
- Next you need to enter your global list id (list that you created previously).
- Go to <your list> => settings => list settings and unique id.
- On the bottom of the page there will be text box "unique id for list <your list>".
- Copy and paste its value to GroupScript settings.
- Now you need to sync your local subscriber list to MailChimp.
- Go to Dashboard => Newsletter status.
- If you cannot see it - it is because you are using custom theme.
- Then copy ALL files from system/application/themes/default/views/backend to system/application/themes/<your theme>/views/backend and overwrite everything.
- In Newsletter status view you can see subscriber count, error log and resync button.
- Press "resync subscribers" button.
- Now local and remote subscriber count should be equal.
- If not - then look for errors below.
If you, for some reason, switch from MailChimp to built-in backend or to another custom backend, GroupScript cannot update remote MailChimp list anymore.
If you switch back to MailChimp you need to update MailChimp list - synchronise with your local list. Be aware that this function first empties (Deletes ALL subscribers of) your MailChimp list, then repopulates it with local subscribers.
Only subscribers with confirmed email addresses are synchronised.
After version 4.1 newsletter backends were changed. If your site does not use double opt-in or uses it with MailChimp - you must execute this against your database.
UPDATE `newsletter_subscribers` SET `email_confirmed`=1 WHERE 1;