Sync Salesforce contacts to Mailchimp audience weekly
Recipe ToolsMarketingCRM
What it does
When a scheduled trigger runs every Sunday at 7:30 PM, this automation queries Salesforce for contacts and syncs them to Mailchimp. It updates existing subscribers, logs errors to a lookup table, and marks sync status in Salesforce.
Who it's for
Marketing operations teams who maintain a Mailchimp audience from Salesforce contacts and need weekly syncs without manual uploads.
How teams use this
Keep Mailchimp audience synced weekly
Run the sync every Sunday so Mailchimp subscribers always match the latest Salesforce contacts. The team gets a job report showing what succeeded and what failed.
Sync only secondary contacts to Mailchimp
Filter the Salesforce query to include only secondary contacts so the Mailchimp audience contains the right segment. The rest of the sync stays the same.
Add custom field mapping to subscriber records
Extend the update step to include additional Salesforce fields when syncing to Mailchimp, such as company or industry. The error handling and reporting remain unchanged.
Notify team of sync errors via Slack
Add a Slack step after error logging so the team gets notified when contacts fail to sync. The lookup table still captures details for troubleshooting.
How it works
- Run sync every Sunday evening. Scheduled trigger runs every Sunday at 7:30 PM to keep the Mailchimp audience current with Salesforce contact data.
- Query Salesforce for contacts. Search Salesforce for all contacts matching the sync criteria using a query, then process each record in a batch loop.
- Search and update Mailchimp subscribers. For each contact, search Mailchimp for a matching subscriber by ID. If found, update the subscriber with the latest contact data from Salesforce.
- Log errors and update status. If an error occurs during the sync, log the message to the job report and add an entry to the error lookup table so the team can review what failed.
- Mark sync complete in Salesforce. Update each contact record in Salesforce to reflect that it was synced to Mailchimp, completing the weekly audience refresh.