This article explains how you can leverage the Salesforce Campaign object to send drip email campaigns to either leads or contacts or both. 


Please note that the instructions here in this article are meant for the newer version of the MassMailer app from this app exchange listing.


You can add either Leads or Contacts or both to the Campaign as campaign members.


Now, let us go through the steps.



Important Notes:

  • Email status values such as open, click, bounce, spam, unsubscribe, etc get logged under a custom object called 'MassMailer Email Status' related to the Lead, Contact, Campaign, and the MassMailer Email Status objects. Activity history also gets logged under these objects.

  • Using the Salesforce Process Builder you can perform many other advanced actions such as creating tasks, updating records, notifying users while creating drip emails/campaigns in Salesforce.


Important Prep Tasks:


Make sure that you have the respective Salesforce Campaign is already created and the initial status is set to 'Planned' and enter the start date based on when you want to start the campaign. You can enter this value later on as well.


Also, make sure that you add the campaign members to the Campaign. Make a note of the 18 digit Campaign Id as you will need this at the time of setting up the processes to filter the respective campaign to trigger the drip campaign.






How to initiate the drip campaign?


In this example, the Campaign Status value is considered as the field to trigger the drip campaign. Once the processes are defined and the campaign is ready, you can go back to the Salesforce campaign object and set the status to 'In Progress' and save the campaign, which will kick off the campaign. You can come up with any other logic to trigger the drip campaign. It is best to consult your Salesforce Admin or work with the MassMailer Consulting services team to help you with the drip campaign setup.



1. Navigate to the Workflow Process builder in Salesforce:


Click on the Salesforce 'Setup' from the top right corner and search for 'Process Builder' from the quick find box in the left side panel.




Click on the 'Process Builder' link from the search results from the above step and click on the 'New' button. This will open a form to enter the workflow process details.



2. Create a Workflow Process that triggers Drip Emails for newly created Campaign Members.


Enter the 'Process Name', 'Description', 'The process starts when' values as per your need and click on the 'Save' button.



3. Choose an Object and Specify when to start the Workflow Process:


Click on 'Add Object' to choose the 'Campaign' object from the list shown. 


Under the 'Start the process' section, select the 'when a record is created or edited' option based on your requirement and click on the 'Save' button.






4. Define Criteria when to trigger the Workflow Process:


Click on 'Add Criteria' and enter 'Criteria Name', select 'Criteria for Existing Actions', fill the 'Set Conditions' section, and then add the conditions logic as per the example is shown in the following picture. 

Make sure you enter the correct 18 digit 'Campaign Id' for the first condition. The second condition is an example only. It can be any other criteria as long as the condition is met to trigger the drip campaign.


Make sure that you check the field 'Do you want to execute the actions only when specified changes are made to the record' to true in the Advanced section.


Once all the information is entered click 'Save' to save the criteria.



5. Define Immediate Action to invoke Drip 1 Process:


Once we are done with the above step, defining the criteria for the main drip campaign, we will click on the 'View All Processes' button and move to Step 7 to define the processes related to Drip 1 & Drip 2. We will come back to this step after that.


Click on 'Add Action' and do the following and click 'Save'.

  • Select the Action Type as 'Process'.

  • Enter the 'Action' Name.

  • Choose the ‘Drip 1' invokable process that is created by following the instructions in Step 7.

  • Select the Process Variable as the 'Select the Campaign record that started this process' and Save.





Immediate Actions, 'Invoke Drip 1' is saved now.



6. Define a Scheduled Action to invoke the Drip 2 Process:


Now we need to define a Scheduled Action by clicking on the 'Set Schedule' link and enter the schedule, for example, 3 days after the Start Date as shown below. Set Time for Actions to Execute depends on your business need. Click the 'Save' button to record the changes.


Click on Set Schedule in the Scheduled Actions box.



Select the time for the action to execute such as 3 days after the campaign member 'created date' and click Save.


Now click 'Add Action' to select Drip 2 invokable process that triggers drip 2 emails.



Click on 'Add Action' and do the following and click 'Save'.

  • Select the Action Type as 'Process'.

  • Enter the 'Action' Name.

  • Choose the ‘Drip 2' invokable process that is created by following the instructions in Step 8.

  • Select the Process Variable as the Campaign that has started this process and Save.





Click Activate to activate the main process.



7. Define the Process related to Drip 1:


Click on the 'New' button to define the Drip 1 process for the example given below.


Enter 'Process Name' 

Tab out to auto-populate 'API Name'

Enter 'Description'

Make sure you select the 'It's invoked by another process' value from the dropdown list for the field, 'The process starts when'

Click on the 'Save' button.


Click on 'Add Object' and select 'Campaign' and click the 'Save' button.



Now you can add any filter criteria by clicking on the 'Add Criteria' link and add any filter conditions.


The criteria you plan to add can also be an exit criterion that there won't be any drip email sent to the campaign member. The following example shows the exit criteria if the Campaign Status is 'Aborted' or 'Completed' then don't take any action further. Once the criteria are entered, click on the 'Save' button.




Now click on 'Add Action' to add the action to send the email alert for Drip 1. 


Select Action Type as 'Apex', Enter Action Name, Select Apex Class as 'Email Via MassMailer'



Enter the following fields: 

'Template Id' (get the Salesforce classic email template ID)

'Record Id Field' (select type as 'Field Reference' and value as 'Campaign ID')

'From Name'

'From Address'

Set 'Send To Campaign Members' to 'True'


and click on the 'Save' button to record the changes.


The following setup will send emails to all the campaign members.



Alternatively, if you want to send emails only to selective campaign member status values, you can set the field, 'Target Campaign Member Status' to 'New' (or any other status want the emails to as comma-separated values. 


The following are the default campaign member status values that MassMailer updates for the campaign members.


New, Processed, Delivered, Deferred, Dropped, Open, Click, Unsubscribe, Invalid, Bounce, Spam Report, Group Unsubscribe, Group Resubscribe



Click on the 'Activate' button to activate the process that we just defined.



8. Clone the 'Drip 1 Process to create Drip 2 Process or define Drip 2 from scratch:


You have two options to create Drip 2. Either you can follow the same steps in Step 7 to define Drip 2 from scratch or clone Drip 1 to create a new process, Drip 2. The following instructions describe how to create the Drip 2 process using the Clone method.


Open the Drip 1 process that was defined earlier and click on the 'Clone' button.


Save Clone as... A new process. Give a Process Name, Description and click Save.



Change the Criteria Name for the Criteria and Save.



Change the Immediate Action Name and the Template ID assuming you want to send a different template for Drip 2 and Save.



Click Activate.




9. Track Email Status on the Lead or Contact Object for Drip Emails/Campaign in Salesforce:


Email status values such as delivered, open, click, spam, unsubscribe, bounce, etc get captured on the Lead or the Contact object in a related list object called 'MassMailer Email Status'.




10. Track Activity History on the Lead or Contact Object for Drip Emails/Campaign in Salesforce:


Activity history gets captured on the Lead or the Contact object.




11. Track Activity History on the Campaign object in Salesforce:


Activity history gets captured on the Campaign object.




12. Track MassMailer Email Events on the Campaign object in Salesforce:


Emails Events gets stored in the MassMailer Email Status object which is related to the Campaign object.




13. Track Campaign Member Status on the Campaign object in Salesforce:


Campaign Member Status gets updated with the latest Email Events and tracked on the Campaign object.



14. Track Email Statistics and Performance on the Campaign object in Salesforce:


Email Statistics such as Total Opens, Total Clicks, Total Unsubscribes get logged on the Campaign object. Also, the campaign performance such as Open Rate, Click Rate has also logged on the campaign object.