Drip Campaigns


I've seen a lot of questions about how EXACTLY campaign emails work. So here is a full explanation of the algorithm and all the edge cases I can think of. This is based on 4.3 but most of this logic has remained unchanged since 4.0.

The campaign mailing job is run once a day. The time of your run is randomly picked so we don't have all customers trying to send at the same time. If it's important to you to send around a certain time of day you can contact support and have your job moved nearer a preferred time (morning, noon, evening)

Step 1: Get a list of the Active Campaigns, we skip over ones that are disabled.

Step 2: For each campaign, ensure its owning agent has permissions to have campaigns. This way we don't delete campaigns of agents if you remove this permission from them.

Step 3: If a Start Date is set for the campaign, check that it is today or in the past. If the job is running near midnight (server time) then the super admins timezone is also taken into consideration. For example if the job is running at 11pm March 31st Central Time, and the admin's timezone is Pacific, then the job knows that its April 1.

Step 4: Get the list of groups currently assigned to this campaign. If none are assigned then bail out and go onto the next campaign.

Step 5: Select leads currently assigned to the campaign. Leads must be subscribed to campaigns and belong to at least one of the campaigns groups. If a lead has bounced or has reported and email as spam in the past they are excluded. If the campaign is owned by an agent, only leads assigned to that agent can be selected.

Step 6: For each lead, determine leads current "Days on Campaign". If the lead is new to this campaign then check the difference between their creation time and now. If the lead was created today, then Days is set to 0, else it's set to 1. If you job runs just after midnight, then all your leads will be 1 day old. If the lead has been here before, get their Days from the database.

Step 7: For leads who's email is on one of the major email providers that requires double opt-in, check that they have double opted-in. Else skip the lead.

Step 8: Select the emails for this campaign, sorted by send delay.

Step 9: For each email, check if the lead has already been sent this email. If they have, skip to the next email. The emails are tracked by an ID. If you remove and re-add and email to a campaign its ID will get reset. But if you only change its Day or Subject or Message it will keep its ID.

Step 10: Check if the lead is old enough for this email. If the leads Days on Campaign is greater than that of the email continue on, if it's equal go to Step 12, else skip to the next lead.

Step 11: If the leads Days on Campaign is larger than the current unsent email, first check if a later email has been sent. If so, then this email will be skipped. If not, then reset the leads Days on Campaign to be equal to the current emails send delay.

Step 12: Send the email!

Step 13: If this was the leads first time on the campaign, mark down the date so we know their Day 1 for future runs.


Q: Is Days on Campaign different per campaign?

A: Yes. Each Campaign / Lead combination has a Days on Campaign remembered. Two campaigns don't share the Days on Campaign of leads, even if the campaigns both use the same group.

Q: What happens if I add new leads that've been around for a while to a campaign?

A: If they were created longer ago than the first email on the campaign, they will have their Days on Campaign set to 1 and begin the campaign at the first email and progress through it normally.

Q: What happens if I add a new email to the middle of my campaign?

A: Any lead that has received a later email will not get the new one. All other leads will get the new email and may have their Days on Campaign adjusted back so that the time between the new email and next email is preserved.

Q: What happens if I add a new email to the end of my campaign?

A: Leads who've long ago finished the campaign will notice they were not sent this new email and reset their Days on Campaigns to the Days for the email and get the new email.

Q: What happens if I remove leads from a campaign and later re-add them? For example, either by removing the lead for a group assigned to the campaign, or removing the group from the campaign.

A: The leads association with the campaign is remembered and their Days on Campaign is kept. So when they are re-added, they will resume the campaign where they left off.


Enjoy this post? Why not share with friends or add a comment of your own?

Share your thoughts…