Support Center | Administration | Technical Guide

Technical guide.

This page contains technical information for experienced Salesforce administrators who are looking for a deeper explanation of the key jobs that run as part of the Campaign Monitor for Salesforce application.

API usage.

Salesforce has strict governor limits around the use of API calls. The Campaign Monitor for Salesforce application does not use any API calls when syncing.

There are two types of API calls, inbound and outbound. Outbound calls from Salesforce do not count against governor limits.

All syncing to and from Campaign Monitor are done via outbound calls. For example, if you are sending 100K emails to Campaign Monitor via any of our syncing methods i.e. subscriber rules, import wizard, list views etc, they will not count against your salesforce API limit.

The only time the Campaign Monitor for Salesforce application uses inbound API calls is when you:
a) Use a Salesforce list view to perform a bulk operation. For example if you select add contacts to a subscriber list when working from a list view or via the import wizard. This will use up just 1 inbound API call.
b) Navigate to the sync settings page. This will use up just 1 inbound API call.

In general, you should not need to worry about the Campaign Monitor application using up your inbound API limits.

Campaign Monitor tab.

When clicking on the Campaign Monitor tab within Salesforce, you may be redirected to a new browser tab. This will open with a direct login to Campaign Monitor.

  • Users will be automatically logged into Campaign Monitor using the Campaign Monitor user ID associated with their Salesforce account. See: Permissions
  • The Campaign Monitor menu in the new tab can be toggled on and off. To enable the Campaign Monitor menu, navigate to Campaign Monitor admin, general and enable the setting Show tabs on the Campaign Monitor layout in Salesforce
  • The new tab is required due to the enforcement of SameSite settings. See: https://blog.chromium.org/2019/10/developers-get-ready-for-new.html

If the tab does not open check your browser settings as the popup might be blocked. See: Block or allow pop-ups in Chrome

Background jobs.

The list below are the batch jobs that can run in the background within Salesforce.

CMBatchCampaign.

Pulls in email history from Campaign Monitor into Salesforce. The records are stored in email tracking history (wbsendit__Campaign_Activity__c). This table may contain a large number of rows. See: Storage. This job runs as part of the primary sync between Salesforce and Campaign Monitor.

CMBatchCampaignStats.

Updates any linked Salesforce campaigns with statistics from the related Campaign Monitor campaign (i.e. number of clicks, bounces, unsubscribed etc). This job optionally runs as part of the primary sync between Salesforce and Campaign Monitor. It runs if the following setting is set to active update Salesforce campaign statistics with Campaign Monitor statistics. See: Manage Campaign Settings.

CMBatchDeleteSubscribers.

Runs as part of the import wizard job if the replace subscribers on list option is enabled under advanced settings. It removes any subscribers from Campaign Monitor that were not in the import wizard report or list view. If there are a large number of subscribers to remove from Campaign Monitor, this job can take a long time to complete. If this is the case, you could also consider creating a completely separate subscriber list for the import and deleting the old list - as this could be more efficient.

CMBatchEmailOptOut.

This batch updates the standard Salesforce email opt-out field on the contact and lead records based on the subscriber status. It will opt out any subscribers that are unsubscribed from all subscriber lists within Campaign Monitor. This job optionally runs as part of the primary sync between Salesforce and Campaign Monitor. It runs when the following setting, in the General Settings, Options is enabled: Set email opt to true when a contact or lead is unsubscribed or deleted in all lists and a contact or lead is unsubscribed or deleted in all lists.

CMBatchSubscriber.

Updates Salesforce with the status of any subscribers it finds in Campaign Monitor. If the create rule is enabled it may create and link new subscribers as contacts or leads in Salesforce along with any mapped fields. This job runs as part of the primary sync between Salesforce and Campaign Monitor. If it is unable to update Salesforce, due to restricted fields etc, then a message will be logged under maintenance messages.

CMBatchSubscriberStats.

Updates Salesforce subscriber lists with statistics from the related Campaign Monitor subscriber list (i.e. number of clicks, bounces, unsubscribed etc). This job runs as part of the primary sync between Salesforce and Campaign Monitor.

CMConfigBatch.

Syncs Campaign Monitor configuration data with Salesforce. This includes syncing any Campaign Monitor lists, clients and users with Salesforce. For example, if a user has created a list directly in Campaign Monitor, then this job needs to have run before it will appear in Salesforce. This job runs as part of the primary sync between Salesforce and Campaign Monitor.

CMScheduleSubscribers.

This is a schedulable job that is called from sendItScheduleSubscriptions when the sync is enabled. It starts the primary sync between Salesforce and Campaign Monitor.

ImportListViewBatch.

Calls from the import wizard, emails from a Salesforce list view into Campaign Monitor.  The process runs under the scheduled user and as such will only have access to the Salesforce records that user can see.

ImportScheduler.

A scheduler for running import wizard jobs. It runs hourly under the Salesforce user who requested the scheduled import jobs. This is to ensure the import wizard runs under the owner of the person who started the job (and therefore can only see records available to them).

ProcessAsyncRecords.

This is a queueable job that runs if it needs to send Salesforce data to Campaign Monitor (typically for a single CRUD operation on an account, lead or contact). It can be invoked from a trigger or process builder action.

It will typically only run if there are a) any mapped fields for the subscriber list that the contact or lead is associated with, or b) if there are automatic subscription rules that meet the criteria for a contact or lead, c) there is an email change on the contact or lead.

You can prevent the ProcessAsyncRecords from being called by setting, disable Salesforce account, contact and lead triggers' to Active under sync settings.

ProcessAsyncRecordsBatch.

This is a batch job that runs if it needs to send Salesforce data to Campaign Monitor. It is similar to ProcessAsyncRecords in that it can be invoked under the same conditions. The difference is that it will run when there are multiple records that need to be processed. It works by processing items held in a custom object called Queue_Item__c. It will continue to process these records in atomic transactions. If there are still more items to be processed in the Queue_Item__c object when the batch job completes, it will re-spawn itself.

N.B. If you are running multiple Salesforce process flows that update the same Salesforce object, this can result in multiple ProcessAsyncRecordsBatch jobs running at the same time. To reduce the chance of this happening, where possible, structure your Salesforce process flows to update the same Salesforce object.

You can reduce the number of ProcessAsyncRecordsBatch being run by setting, disable bulk triggers for account, contact and lead triggers' to Active under sync settings. This will result in only the first record in a transaction being processed.

RefreshCampaignHistory.

Manages the space used by the email tracking history object. See: Storage. This job can take a long time to run if a full re-import of Campaign Monitor data into Salesforce has been requested. See: Maintenance

RefreshSubscribers.

Clears out the subscriber list member (wbsendit__Subscription__c) object. It’s called when a full refresh is requested a full re-import of Campaign Monitor data into Salesforce. See: Maintenance

ReportToListBatch.

Called as part of the import wizard, this imports subscriber details from a Salesforce report into Campaign Monitor. It can run as a one off manually initiated job or via a scheduled process (if the user has configured this via the import wizard).

SmartEmailBatch.

Updates Salesforce with smart email template details fetched from Campaign Monitor. This job runs as part of the primary sync between Salesforce and Campaign Monitor. See: Transactional

SmartEmailDetailsBatch.

Updates Salesforce with smart email template variable details fetched from Campaign Monitor. This job runs as part of the primary sync between Salesforce and Campaign Monitor.

SmartEmailTaskDetailsBatch.

Updates tasks in Salesforce that were sent as part of a smart email. It pulls in the actual text that was sent to the subscriber. This job runs as part of the primary sync between Salesforce and Campaign Monitor.

Process Builder Invokable Action.

The Salesforce process builder is a powerful tool and when combined with Campaign Monitor for Salesforce, it provides fine grain control over sending targeted transactional emails to subscribers.

The trade off comes with the complexity of setting up and debugging processes. To help troubleshooting emails that are not sending, you can test the last step in the process builder action with the code below (i.e. try running the code in the Salesforce developer console). This is essentially the code that is called when you use the smart email invokable action in the process builder. If the code below works, then any problems are likely to be related to the fact that the invokable action is not being triggered i.e. a status on a field used in your Salesforce process builder logic may not be correct etc.

You can also test your Salesforce process by creating a dummy task or updating a value on an object. The code below will help check if the correct ID's were used in the smart email invokable action in the process builder.

There are two main variables you need to find and use:

  1. RootObject (Record ID) - This is the ID of the Salesforce record i.e. contact ID, lead ID etc.

  2. Smart email mapping ID - This is the ID found on the smart email mapping record.

When selecting the object to base the process on in the Process Builder, avoid checking "Recursion - Allow process to evaluate a record multiple times in a single transaction?" - this can cause issues with Salesforce governance limits, as the action may be called multiple times.

Salesforce domain name.

The Salesforce process builder is a powerful tool and when combined with Campaign Monitor for Salesforce, it provides fine grain control over sending targeted transactional emails to subscribers.

If you are using Salesforce Lightning but don't have a Domain set up, you may receive the error similar to this: No CONTROLLER named js://wbsendit.pagination found

Salesforce requires a domain to be set up in order to use Lightning components, which are used as part of the Campaign Monitor for Salesforce application. See Enable My Domain To Use Lightning Components

Setting up a Salesforce Domain will remove this message.

This video walks you through setting up a Domain Name.

Was this article helpful?

Thank you. Your feedback has been received!
Oops! Something went wrong while submitting the form.

© 2020 Beaufort 12 Limited is a company registered in England and Wales with company number 8174703
Privacy Policy | Terms & Conditions | Cancellation Policy