date based emails in drip

Date Based Emails

Deliver a webinar reminder the day before, a subscription notification one week ahead of the charge, or a happy birthday email on your subscriber's special day.

Sending messages based on a date has lots of value.

Visual Learner?

Click to watch the video!

How to Send Date Based Emails in Drip

The first point to make is, you can do it! While you may not be aware this exists or is even possible—you can indeed send emails on a specific date in Drip.

What's Needed?

Your date coming into Drip in the YYYY-MM-DD format. With this, we can send emails on specific calendar days.

Using a little bit of Liquid code we'll make it happen.

With just these two things you'll be sending date based emails in no time.

Using a Rule

You've probably created a rule before in Drip. Did you know this is how we can send date based messages?

If you didn't, you're not alone. This is a seldom used tactic that frequently gets glossed over.

For actions in the rule, you can set when you want them to perform.

Drip Rule - Perform this action

Immediately, after a delay, or based on properties of the trigger event.

Properties of the Trigger Event

We'll use this option. With our date in the YYYY-MM-DD format we'll utilize Liquid code to send the email on a specific date.

Here's an example of what that Liquid code might look like:

{{ subscriber.custom_field | timestamp | minus: 86400 | date: '%F' }}
Wait, what?!

I hear you. When you don't know what's going on that code can be intimidating.

Soon the Liquid code won't spook you. Not even the slightest.

Let's break down what's happening in the rule to "Perform at"...

Perform at With Liquid Code

We're manipulating the custom field which triggers this rule using Liquid code. Modifying the data allows date based messages to be sent.

This is what's happening on each portion of the code:

subscriber.custom_field

We call on the custom field that has our date in the YYYY-MM-DD format.

Let's say our date is 1999-12-25

timestamp

Turns the date from YYYY-MM-DD into a number we can do math on.

For our date, 1999-12-25 this would be 946080000

If you're curious for more info on this, check out Unix timestamps.

minus: [number]

This takes away a number of seconds we need from the timestamp we created.

It's really the key for sending date based emails on the right day.

We could also use plus: [number] to add seconds. This also works for sending on the proper date.

Here's a quick list of second amounts that are helpful when sending date based emails:

3,600 seconds = 1 hour

86,400 seconds = 1 day

604,800 seconds = 1 week

2,592,000 = 30 days

If we wanted to send an email on 1999-12-24 which is one day before our date of 1999-12-25 then we'd use minus: 86400 seconds in our code.

date: '%F'

Once we remove or add the proper amount of seconds, this converts the timestamp back into the YYYY-MM-DD format.

That's it, you did it! Now you know exactly what the code below is doing.

{{ subscriber.custom_field | timestamp | minus: 86400 | date: '%F' }}
See, I told you it's not that hard!

You can do it, too.

Watch the video below for a visual walk-through of all the steps we covered above.

Watch the step by step video for guidance