Add Dynamic Subscriber Data to Your Drip Emails (via Liquid)

In this article

How personalization works

Drip is integrated with a templating language called Liquid. Created by Shopify, Liquid allows you to dynamically insert your subscribers' individual data into the emails you send to them. Probably the most common use case for this would be to greet subscribers by their first names at the beginning of an email.

If you aren't familiar with Liquid up to this point, we've put together a short Liquid Guide to help you get going. In that guide, you'll learn about the Liquid shortcodes that we've created for Drip specifically.

The following is an example of such:

{{ subscriber.email }}

As you can see, the shortcode opens and closes with sets of curly braces. You are free to include additional text on either side of the shortcode.

Here is an example of that shortcode being used in an email:

Here is how the email would be rendered and sent to a subscriber with an email address of “erika@company.com”:

Previewing Your Liquid Shortcodes

When working with Liquid, you can preview how your emails will appear by viewing it under the Preview tab in the email editor.

You can preview how the email will render for a specific subscriber by entering their email address in the Preview as a subscriber sidebar to the right of the email editor:

Drip specific shortcodes

In your email editor, go to the HTML tab, then click View Shortcodes:

You'll see all of the Drip specific shortcodes that you can use throughout your emails. Again, if you're just getting started with Liquid, we suggest you check out our Liquid Guide.

Dynamic Subscriber Data

Liquid Shortcode

Email Address

{{ subscriber.email }}

Time Zone

{{ subscriber.time_zone }}

id

{{ subscriber.id }}

utc offset

{{ subscriber.utc_offset }}

Visitor UUID

{{ subscriber.visitor_uuid }}

Status

{{ subscriber.status }}

Friendly Time Zone

{{ subscriber.friendly_time_zone }}

Tags

{{ subscriber.tags }}

created at

{{ subscriber.created_at }}

Lead Score

{{ subscriber.lead_score }}

EU Consent

{{ subscriber.eu_consent }}

Campaign Name

{{ campaign.name }}

Next Email Sending Time

{{ campaign.next_email_send_at }}

“From” Name

{{ from_name }}

“From” Email

{{ from_email }}

Postal Address

{{ postal_address }}

Inline Postal Address

{{ inline_postal_address }}

HTML Postal Address

{{ html_postal_address }}

“View In Browser” URL

{{ view_in_browser_url }}

Opt-In Confirmation URL

{{ confirmation_url }}

Unsubscribe URL

{{ unsubscribe_url }}

Manage Subscriptions URL

{{ manage_subscriptions_url }}

“View In Browser” Link (permalink)

{{ view_in_browser_link }}

Opt-In Confirmation Link

{{ confirmation_link }}

Unsubscribe Link

{{ unsubscribe_link }}

Manage Subscriptions Link

{{ manage_subscriptions_link }}

Current Time

{{ now }}

Date Filter: Current Time in Unix

{{ now | timestamp }}

Date Filter: Current Time rendered in M, D, Y format

{{ now | date: “%a, %b %d, %y” }}

Date Filter: Seven days from now (adding seven days in Unix)

{{ now | timestamp | plus: 604800 }}

Date Filter: At midnight, seven days from now

{{ now | at_midnight | timestamp | plus: 604800 }}

Date Filter: Current Time in a Specific Time Zone

{{ now | in_time_zone: “America/New_York” }}

Date Filter: Current Time in a Subscriber’s Time Zone

{{ now | in_time_zone: subscriber.time_zone }}

Drip specific filters

Example Usage

advance_date_to_next

{{ now | advance_date_to_next }}

at_midnight

{{ now | at_midnight }}

days_since

{{ "January 1, 2018" | date: "%b %d, %y" | days_since }}

days_until

{{ "January 1, 2019" | date: "%b %d, %y" | days_until }}

default

{{ your_variable | default: “Your default text” }}

hmac_sha256

{{ your_variable | hmac_sha256: “A private key” }}

hyperlink

{{ your_variable | hyperlink }}

in_time_zone

{{ now | in_time_zone }}

md5

{{ your_variable | md5 }}

replace_inner_html

{{ unsubscribe_link | replace_inner_html: “New text goes here” }}

strip_commas

{{ your_variable | strip_commas }}

timestamp

{{ now | timestamp }}

url_encode

{{ your_variable | url_encode }}

weeks_since

{{ now | weeks_since }}

weeks_until

{{ now | weeks_until }}

Data needed for personalization

The most common way to collect data that can be dynamically inserted into emails is through information your subscribers give you when filling out your opt-in forms. That data is automatically stored in custom fields.

If you have imported subscribers into your Drip account with information other than the required email address, Drip will store that information in custom fields.

Third party integrations and APIs will oftentimes send data into Drip as custom fields.

Go to Subscribers > Custom Fields to see a list of your custom fields.

There’s a good chance that your custom fields will be different from the ones seen in the screenshot above.

How to apply personalization

Dynamically inserting subscriber custom fields

All subscriber custom fields are available for use in emails. Some platforms use merge tags or other dynamic methods to achieve the same result.

Shortcode syntax:

{{ subscriber.custom_field_identifier }}

The predefined variable “subscriber” does not need to be modified.

Include Liquid shortcodes wherever you would like dynamic subscriber data to be inserted.

Here is an email example using the “first_name” and “registration_status” fields in the email:

Once you've added some personalization to an email, you can go to the Preview tab to make sure everything is rendered correctly:

This will all work great if you have that data saved for every subscriber that you send the email to, but that might not be the case.

Here's how that same email will render for a subscriber that we do not have a value saved for their first name:

As you can see, an undesirable space is created where the first name should be. This is because we do not have that particular subscriber's first name. Luckily that's a pretty easy fix.

Using Liquid’s "default" filter, you can set default text for subscribers that do not have values for the custom fields you are using in the shortcode.