Technical Guide
This page contains technical information for experienced Salesforce administrators who are looking for a deeper explanation of the key jobs.
API usage
Salesforce imposes strict governor limits on API usage, which can impact various operations. However, it's important to note how these limits apply when syncing with Mailchimp:
Types of API Calls:
Salesforce categorizes API calls as either inbound or outbound:
Inbound API Calls: These are calls made to Salesforce from an external system.
Outbound API Calls: These are calls made from Salesforce to an external system.
Impact on Governor Limits:
Outbound Calls: Crucially, outbound calls from Salesforce do not count against the governor limits. This is significant when syncing with Mailchimp.
Inbound Calls: Only these calls count against your Salesforce API limits.
Syncing with Mailchimp:
All syncing operations to and from Mailchimp are performed using outbound calls. For example, sending 100,000 emails to Mailchimp through various syncing methods (like subscriber rules, import wizard, list views, etc.) will not impact your Salesforce API limits. The only scenarios where inbound API calls are used, and thus count against your limits, are:
a) When using a Salesforce list view for bulk operations, such as adding contacts to a subscriber list. This will consume just 1 inbound API call.
b) When navigating to the sync settings page, which also uses up just 1 inbound API call.
In general, you should not need to worry about the Mailchimp application using up your inbound API limits.
Custom Objects
When the installation has been completed, the Salesforce objects below will be created in your Salesforce Org. These objects contain either records or settings required for our application to work. Our product has been designed to be self-contained, not to impact standard objects.
- Mailchimp Account
- Mailchimp Campaigns
- Mailchimp Email Activity
- Mailchimp Group
- Mailchimp Group Category
- Mailchimp Import
- Mailchimp List
- Mailchimp List History
- Mailchimp Member
Our object structure should not be customized, as it may stop our application from working correctly or stop automated upgrades.
Background jobs
The list below are the batch jobs that can run in the background within Salesforce.
McCampaignBatch
Imports Mailchimp Campaigns into Salesforce. This includes high-level statistics and metadata optionally used when syncing and storing detailed email activity (se: McEmailActivityBatch). The records are stored in the Salesforce object Mailchimp_Campaign__c
.
McConfigBatchSyncs
Mailchimp configuration data with Salesforce. It loops through each connected Mailchimp Account and collects metadata around Mailchimp Audiences (Lists). If an Audience has been deleted directly from Mailchimp, this batch will also delete the Audience from Salesforce.
McEmailActivityBatch
If the sync is configured to store detailed Email Activities (such as Opens, Clicks, etc.), this job will call Mailchimp and store the details in Salesforce. Storing detailed Email Activities is only required if the data is used for Salesforce reporting on the individual opens, clicks, etc. The data can use up a significant amount of Salesforce storage and greatly add to the time it takes for the sync to run. It’s not required for use in the Lightning Components. The records are stored in the Salesforce object Mailchimp_Email_Activity__c
.
McGroupBatchSyncs
Mailchimp Group (Interest) records with Salesforce. Any group records deleted directly in Mailchimp will be deleted from Salesforce as part of this batch job. The records are stored in the Salesforce object Mailchimp_Group__c
. More information on Mailchimp groups can be found here Getting Started with Groups | Mailchimp
McListHistoryBatchSyncs
Mailchimp Audience growth history records with Salesforce. These records provide a month-by-month summary of a specific Audience’s growth activity. The records are stored in the Salesforce object Mailchimp_List_History__c
.
McMemberBatchSyncs
Mailchimp Member records with Salesforce. This includes status information about a Member. E.g. email john.smith@beaufort12.com is Active. etc. If the sync is configured to store detailed Email Activities, this batch job will also collect detailed recent unsubscribed and bounced stats. Collecting these details stats can significantly increase the time it takes for the primary sync to run.
McMemberCountBatchCollects
Mailchimp metadata used in subsequent batches. It also syncs Mailchimp Category Group records to Salesforce. Mailchimp categories group together related groups/interests. More information on Mailchimp groups can be found here Getting Started with Groups | Mailchimp
McProcessAsyncRecords
Batch process triggered when a Salesforce user updates a contact or lead. In turn, this checks if there is a linked Mailchimp Member to update. If so, a Queue Item is created to store the details, and it then attempts to update the related Mailchimp member with the mapped Salesforce details in an asynchronous batch. We will delete the Queue Items after processing.
McProcessBatch
Bulk removes Mailchimp records from Salesforce that are no longer required. For example, if a Mailchimp Account is disconnected from Salesforce, this batch will remove all related data in Salesforce.
McRuleBatch
Rules are used to process Mailchimp records in Salesforce. For example, you may have configured the Rule to create a Salesforce contact for new Mailchimp Members. This batch processes those rules.
McWizardReportBatch
Pushes Salesforce records to Mailchimp in bulk. This is used when a Data Wizard job has been configured to push records from a Salesforce report to Mailchimp.
McWizardSoqlBatch
Pushes Salesforce records to Mailchimp in bulk. This is used when a Data Wizard job has been configured to push records from a Salesforce List View, SOQL or Salesforce Campaign to Mailchimp.
Sandboxes
You can install our integration in one or more sandboxes. You can also refresh a sandbox and our application will be copied across below is some more detailed information.
How to install in a sandbox
To install in sandbox simply click the button below. You will be prompted for you sandbox credentials. Keep in mind sandboxes are for testing so we don't recommend connecting you actual Mailchimp account instead set up a free account for testing.
Sandbox refresh
When you start a sandbox refresh a copy of your installed applications will also be copied. This will include Mailchimp for Salesforce and there are some important points below to consider.
- We do not recommend you connect any sandbox to your live Mailchimp account.
- When a sandbox refresh happens we use a standard Salesforce process to disconnect Mailchimp from Salesforce.
- You can also manually run a process before or after the sandbox refresh to clear out connection settings.
- When performing a refresh, whether for a full or partial sandbox, data from our objects can be copied from the production environment.
We don't recommend connecting a sandbox to your live Mailchimp account. Changes made in a sandbox can incorrectly update your Mailchimp data. Mailchimp offers free accounts you can use to test.
Sandbox conflicts
As mentioned above when refreshing a Salesforce sandbox, there may be some settings carried across from production. It is worth noting we do have some code that runs as part of the refresh to avoid this. But in very rare scenarios, the code can be conflicted with. So to help we have two options to return settings to their default state.
Before starting the sandbox refresh
When refreshing the Salesforce sandbox, there is now an option to run a post-installation script. You can enter the value McSandboxPostCopy this will execute our code to clear out the settings.
After the sandbox refresh
When refreshing the Salesforce sandbox our product should auto disconnect if that does not happen due to a conflict you can perform a reset manually.
1. Go to Salesforce Developer Console.
2. Open an execute anonymous window.
3. Type in this code mone.McAPI.resetData();
4. Click Execute.
How to test in a sandbox
When you have our product in a sandbox we recommend connecting it to a test Mailchimp account. The best way to setup a test account is to create a new Mailchimp account that is pay-as-you-go. This will allow you to test features in a dedicated account.
How to Uninstall
If you have purchased our product and have an active subscription you will need to contact us first. Once your subscription is canceled or you are in trial follow these steps:
1. Go to our Settings Tab.
2. Click on Maintenance.
3. Click Remove Layouts.
4. Once the layouts have been removed click User Security.
5. Select All Users that have one of our permission sets
6. Click Edit Permissions.
7. Select None.8. Click Assign Permission Set.
9. Finally click here (Installed Packages)and select uninstall next to Email Made Easy (Mailchimp). The uninstall will report if there are components it can't remove for you. Address each by hand and then re-run the uninstall.
You need to be a Salesforce system administrator to peform the uninstall process.