4. Update Unsubscribes in Mailchimp when a Contact is Unsubscribed in Salesforce

Business Problem

Mailchimp - Logo

Mailchimp is a great tool for people who are just starting out with email marketing and they currently use Salesforce as their CRM. We have done several implementations of Mailchimp and Salesforce and wanted to provide you with our best practice approach of how to set it up right the first time.

This is Part 4 of how to setup the Mailchimp to Salesforce integration where we will show you how to solve the following business challenge we ran into while implementing Mailchimp for Salesforce. Check out our Mailchimp How To section for additional tips on how to extend this integration.

  • Unsubscribe Contact in Mailchimp when they are unsubscribed in Salesforce:

    • There is a way to Unsubscribe a Contact from Mailchimp inside Salesforce using the Manage Subscriptions button on the Visualforce page in the Mailchimp package. This will unsubscribe the Contact in Mailchimp and then update the Email Opt Out field in Salesforce.
    • BUT...if you have any fields that trigger a process to update Email Opt Out = True, then you need to build a special solution for your users. In our scenario, users update a field called Do Not Contact = True and this automatically updates the Email Opt Out = True. Then the Mailchimp integration will not sync this update from Salesforce because it blocks all Contacts from the query that have Email Opt Out = True. If you do not have any scenarios like this to solve for, you can use the Manage Subscription button successfully. If you do, keep reading...

  • There is currently not a way to update Mailchimp when a Contact is updated to have Email Opt Out = True. This is because the Mailchimp sync does not allow you to query on the Email Opt Out field at all and you are unable to sync an unsubscribed Contact to Mailchimp. This article will show you how to work around this issue and let you users opt people out from Salesforce successfully regardless of the scenario.

Or continue on for a short tutorial below.
Note: The video tutorial goes way more in depth.

Please Note

If you choose to use this solution, your users will need to update a new custom email opt out field ONLY. You should not give them access to edit both the Email Opt Out field and the custom field. We created a new field called MC Email Opt Out. You can always change the field label to be Email Opt Out and keep the API Name = MC_Email_Opt_Out__c if the name is confusing your users.

If you implemented the Part 2: Mailchimp to Salesforce Integration - Update Unsusbcribes in Salesforce, you will need to follow the instructions below to update a couple of steps in that automation.

How to Instructions

How to Unsubscribe a Contact in Mailchimp if they are Unsubscribed in Salesforce

Our objective here is to setup Mailchimp and Salesforce to automatically unsubscribe people in Mailchimp when a Salesforce user unsubscribes a Contact in Salesforce. We also want to make sure any automations that update the Email Opt Out field will also work successfully.

First, we need to create a new checkbox field called MC Email Opt Out on the Contact object. You will want to remove the standard Email Opt Out field from the page and have your users use this new field only.

IMPORTANT: If you have any automations that are updating the Email Opt Out = True, you will need to change these to update the MC Email Opt Out = True instead.

Next, we need to add this new field to Mailchimp.

In Salesforce, go to MC Setup -> Audiences -> Map Fields

  • Go to Add a new audience field, choose Field Type = Text and Name = MC Email Opt Out.
  • Click Add Field.
  • Map it to the correct Salesforce Contact field.

  • Login to Mailchimp
  • Go to Automations -> Create Journey

You may be presented with a screen of template choices, choose to build your own.

  • Select Contact Activity -> Audience field changes

  • Audience field = MC Email Out Out
  • What should the new field value be? = true

  • Name the journey

  • Click Choose a Starting Point

  • Click Add a journey point

  • Choose Unsubscribe

  • Click Save

  • Click Continue

  • Tell Mailchimp what the journey is for.
  • Click Turn On

How to Test the Automation

  • Go back to Salesforce and update any Contact in Salesforce (this contact must also exist in Mailchimp) to have MC Email Opt Out = True on their Contact record.
  • Go to the MC Setup tab in Salesforce -> Sync Audience

  • Go to Mailchimp, go to the Contact you modified in Salesforce and confirm you see the MC Email Opt Out = true.

  • Go to the Journey in Mailchimp and check to see if the Contact has been processed. It will take a couple of minutes.

Note from Mailchimp on Processing Time for Contacts: Journey Point actions can take up to 15 minutes to process.

  • Go to the Contact in Mailchimp and confirm they are now Unsubscribed.

  • Go to Salesforce and confirm the contact you modified has Email Opt Out = True.

Congratulations, you have just automated unsubscribes from Salesforce to Mailchimp! Don't forget to make sure your users only use the MC Email Opt Out field. Remember to update any automations you had that were updating the Email Opt Out = True, you will have to change those to update the MC Email Opt Out = True instead - then let Mailchimp update the Email Opt Out field with the sync back to Salesforce.

For any questions, comments, concerns – let us know in the comment section below!
We would love to hear from you!

Share This Story, Choose Your Platform!

About the Author

Cheryl Fernandes

Cheryl is a certified Salesforce Application Architect and is the Founder and Lead Salesforce Consultant at Blu Ninjas. She has been working with Salesforce for 12 years and has helped companies in financial services, insurance and beauty industries implement solutions on the platform. Flow is her favorite Salesforce declarative tool, it is a game changer for anyone who does not know how to code.

How to Update Part 2 - Update Unsubscribes in Salesforce

If you implemented the Part 2: Mailchimp to Salesforce Integration - Update Unsusbcribes in Salesforce and you are using automation in this article, you will need to follow these steps to update the Part 2 automation to accommodate this new field.

  • Go to the flow you created in Part 2 called MC Subscriber | Update Fields on Contact and edit the Update Contacts element under the Decision = Unsubscribed.

  • Scroll down to the Set Field Values for the Contact Records.
  • Add the following criteria: MC_Email_Opt_Out__c = True

  • Edit the Update Contacts element under the Decision = Subscribed.

  • Scroll down to the Set Field Values for the Contact Records.
  • Add the following criteria: MC_Email_Opt_Out__c = False

  • Save this new version of your flow. Debug it to make sure it is working properly. Then you are ready to Activate it!

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top