Mailchimp to Salesforce Integration – Part 2

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 2 of how to setup the Mailchimp to Salesforce integration will show you how to solve the following business challenge we ran into with implementing Mailchimp for Salesforce. Check out Mailchimp to Salesforce Integration – Part 1 and Mailchimp to Salesforce Integration – Part 3 for additional tips.

  • Inability to update Contacts and Leads if they unsubscribe or their email bounces – Mailchimp integration does not provide a way to directly update the Email Opt Out field on the Contact or Lead. Zapier is a tool recommended to do this for you, but we ran into API limit issues with large volumes of contacts. Plus, you are limited to the actions Zapier provides between the two applications. We will use process builder to update Leads and Contacts from the MC Subscriber data syncing to Salesforce from Mailchimp.

How to Instructions

Update Unsubscribes & Bounce backs in Salesforce

In this section, we are going to create a process builder that will update the Email Opt Out, Active Email Subscriber and Undeliverable Email Address checkboxes on the Lead or Contact from the MC Subscriber records created from Mailchimp. The Email Opt Out field is the standard field on the Lead and Contact objects. Unfortunately, we cannot create a package for you to install because we are building on the Mailchimp custom objects. Follow these steps to configure Salesforce to automate these updates.

Create the following fields on the Lead and Contact objects (if you are not using Leads, just do this for Contacts):

  • Active Email Subscriber – checkbox
  • Undeliverable Email Address – checkbox
  • Go to Setup | Process Builder in Salesforce and create a new process builder on the MC Subscriber object.
  • 1st Criteria = MC Member Status = Unsubscribed – this criteria will fire when the Member Status is changed and has a value of UnsubscribedMake sure to check the Yes checkbox under the Advanced tab!
    • Use this formula:
AND (
ISCHANGED ([MC4SF__MC_Subscriber__c].MC4SF__Member_Status__c ),
TEXT([MC4SF__MC_Subscriber__c].MC4SF__Member_Status__c) = "Unsubscribed"
)
  • Configure the Immediate Action to update the Email Opt Out = True, Active Email Subscriber = False and Undeliverable Email Address = False checkboxes on the Contact records related to the MC Subscriber record. Repeat this and add another action for Leads if you are using Leads.
  • 2nd Criteria = MC Member Status = Subscribed - this criteria will fire when the Member Status is changed and has a value of SubscribedMake sure to check the Yes checkbox under the Advanced tab!
    • Use this formula:
AND (
ISCHANGED ([MC4SF__MC_Subscriber__c].MC4SF__Member_Status__c ),
TEXT([MC4SF__MC_Subscriber__c].MC4SF__Member_Status__c) = "Subscribed"
)
  • Configure the Immediate Action to update the Email Opt Out = False, Active Email Subscriber = True and Undeliverable Email Address = False checkboxes on the Contact records related to the MC Subscriber record. Repeat this and add another action for Leads if you are using Leads.
  • 3rd Criteria = MC Member Status = Cleaned – this criteria will fire when the Member Status is changed and has a value of CleanedMake sure to check the Yes checkbox under the Advanced tab! Cleaned in Mailchimp means the email address hard bounced and Mailchimp will prevent these email addresses from going into future campaigns. You can archive these records in Mailchimp, so they are not included in your contact count.
    • Use this formula:
AND (
ISCHANGED ([MC4SF__MC_Subscriber__c].MC4SF__Member_Status__c ),
TEXT([MC4SF__MC_Subscriber__c].MC4SF__Member_Status__c) = "Cleaned"
)
  • Configure the Immediate Action to update the Active Email Subscriber = False and Undeliverable Email Address = True checkboxes on the Contact records related to the MC Subscriber record. Repeat this and add another action for Leads if you are using Leads.
  • Click Activate - now it is time to test and make sure the process is working!

Check out the 3rd part in our Mailchimp to Salesforce Integration series, where we show you how to solve some general business challenges we have run into with implementing Mailchimp for Salesforce. Any comments, questions, concerns – let us know in the comments! We would love to hear from you!

Any comments, questions, concerns – let us know in the comments! 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 Lead Salesforce Consultant at Blu Ninjas. She has been working with Salesforce for 10 years and has helped companies in financial services, insurance and beauty industries implement solutions on the platform. Process builder and flow are her favorite declarative tools, these tools are a game changer for anyone who does not know how to code.

18 thoughts on “Mailchimp to Salesforce Integration – Part 2”

  1. Hi Cheryl. Thank you so much. This is fantastic and extremely helpful. The sync works extremely well at the Saleforce end capturing with changes in Mailchimp. Have you found a way to let Mailchimp know if, for example, you’ve deleted a contact in Salesforce? I spotted a slight mistake which doesn’t detract from the very powerful instructions provided but might catch out the unwary. There is an incorrect image in the section “MC Member Status = Subscribed”. The Immediate Action “Email Opt Out” shows Value= True when it should be set to False as per the instructions.

    1. Hi David,

      Thanks again for helping us find the incorrect images and the comments issue!! You are our hero! I just posted this answer in the trailblazer community. Let me know what you think:

      I looked into how we could automate removing a contact from MailChimp whenever a Contact is deleted in Salesforce. This is a tough one! First I tried to sync a contact to MailChimp that had Email Opt Out = True and the Member Query will not pick it up. So this was a dead end, you cannot sync contacts with Email Opt Out = True – which makes perfect sense.

      It looks like we would have to get creative and might be able to achieve it, but it would be workaround on top of workaround. First, you would need to create a Record-Triggered flow that triggers when a record is deleted. If you update a ‘specific custom field’ (this would need to be a custom field in MailChimp and in Salesforce) on the Contact that triggers them to go into a Member Query, then you could sync the Contact to MailChimp with a tag. Then you could use a Journey in MailChimp that whenever a change is made to the specific custom field, you Unsubscribe the Contact. Sounds fine and dandy until you look at the frequency you can run the member query to sync the Contacts to MailChimp – only once per day. So the record-triggered flow would have to update the ‘specific custom field’ and then pause until after the Member Query runs, then you could allow the flow to finish and complete the record delete. Not a fan of this because it would confuse the user – they would not know why the record still existed when they just deleted it. Maybe you could use the ‘specific custom field’ to show/hide rich text on the Lightning page to let the user know the record will be deleted within 24 hours. You could also use a validation rule to prevent the user from making any further edits to the record.
      If you are interested in the steps on how to do this, let me know and I can mock it up. I am not warm and fuzzy on the solution though but I think it could get you where you want to go. Another clincher is you must the Standard or Premium plan in MailChimp in order to use Journeys.

  2. Hello — I just implemented this process and it worked perfectly, so thank you! I also wanted to point out that when copying and pasting the three formulas above, you may get a syntax error for the first and third. That’s because the first quotation mark (surrounding “Unsubscribed” and “Cleaned”) is upside down. This is due to the font type chosen for those two formulas in the article (the second formula’s font type is different and does not throw an error). To fix this, you can either try using ctrl+shift+v to paste without formatting or simply re-type the quotation marks once you paste the formula into the Process Builder formula box. (Or Blu Ninjas can match the font type of the second formula to be used for the first and third.) Thanks again!

    1. Hi Neil,
      Thanks for pointing that out!

      I went ahead and removed the smart quotes and put in the plain quotes, to help prevent issues. Also, thanks for trying to help out, by giving the option to paste without formatting.

  3. 12 months later & this article is still helping people out! One question though – what is the reason for having the Active email subscriber checkbox as well as the standard Email opt out checkbox?

    1. Hi Mike,
      That’s great to hear! Some companies do not sync their entire contact/lead database over to MailChimp, so it is helpful for reporting purposes to know who is subscribed in MailChimp and who is not when running reports in Salesforce. If you are syncing your entire database, then I can see how the Active Email Subscriber checkbox would not be helpful.

  4. Is the 2nd Criteria working like it should? The flow will fire when the Member Status is changed and has a value of Subscribed. I guess it’s not going to trigger if the subscriber is a new one but only if it’s existing Mailchimp contact and its status changes?

    1. I guess you should add an ISNEW check and OR clause if you want it to fire on create. The ISCHANGED formula returns false on create. Then the workflow rule is not updating the field when the record is created, just when the record is updated.

      1. Hi Tommi,

        Sure, you could add ISNEW() to the criteria so the process will also fire when a new record is created. It does make sense to add it to the 2nd criteria where we are looking for the Member Status = Subscribed since this is usually the first status a member has.

          1. Hi Erika,

            Here is an example of the first formula using the ISNEW() function:

            AND ( TEXT([MC4SF__MC_Subscriber__c].MC4SF__Member_Status__c) = “Unsubscribed”,
            OR( ISCHANGED ([MC4SF__MC_Subscriber__c].MC4SF__Member_Status__c ),
            ISNEW()
            )
            )

            I have not tested this, let me know if it works for you.

  5. Why to use a process builder for populating checkboxes when this information can be shown on formula fields on contacts and leads?

    1. Hi Tommi,

      You could create a lookup field from the Contact to the MC Subscriber object and then use formula fields for Active Email Subscriber and Undeliverable Email Address. But you would still need an automation to do two things: (1) Update the lookup field (2) Update the Email Opt Out field since this is a standard Salesforce field. I do not recommend creating a custom Email Opt Out field – we should always use the standard one. Another reason to update fields on the Contact instead of using formula fields is it allows you to move away from 3rd party tools easier. You may outgrow MailChimp one day and need to move to another platform. You will not have to migrate the data if it is in fields on the Contact that are not tied to the MailChimp objects directly. Final reason is you may be using another tool for email or you may be emailing directly from Salesforce. Having checkboxes allows your users to update this information if needed as well.

  6. Under the immediate actions section I cannot pull up the Email Opt Out = False, Active Email Subscriber = True and Undeliverable Email Address = False option. I don’t understand why. Please please help!! The only subscriber information I can pick from the dropdown list is ‘MC Subscriber’

  7. Under Immediate Actions, I was able to only enter in one of the three: Email Opt Out = False, but not Active Email Subscriber = True NOR Undeliverable Email Address = False option. I don’t understand why the first one worked, but I can’t find the Active Email Subscriber nor Undeliverable Email Address

Leave a Reply

Your email address will not be published.

Scroll to top