In this article

 

How personalization works

Drip is fully integrated with an open source templating language called Liquid. Created by Shopify, Liquid allows you to dynamically insert personalized data into the emails you send, like using a subscriber’s first name.

Full Liquid documentation can be found here.

Here is a basic Liquid shortcode that will render a subscriber email address when inserted into an email:

{{ 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:

subscriber-email-shortcode

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

email-subscriber

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.

preview-tab-editor-ex

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:

preview-as-window

Drip specific shortcodes

We have created a few Drip specific shortcodes that can easily be inserted into emails via the email editor:

shortcode-list-email-editor-ex

Dynamic Subscriber Data Liquid Shortcode
Email Address {{ subscriber.email }}
Time Zone {{ subscriber.friendly_time_zone }}
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 | 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 }}


 

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 often times send data into Drip as custom fields.

To see a list of your custom fields:

Navigate to Subscribers > Custom Fields

custom-field-view

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


 

Implementing 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 “company” custom fields in the shortcode:

shortcode-cut-field-ex

Here is how that email would render for a subscriber with a “first_name” field equal to “Sam” and a “company” field equal to “Acme”:

shortcode-rendered-ex

The last example will work great if you have that data for every subscriber the email is sent to, but that might not be the case.

Here is how that same email will render for subscribers that do not have values saved for the custom fields being used:

custom-field-novalue

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.

 

Setting default text

 

Shortcode syntax using the default filter:

{{ subscriber.custom_field_identifier | default: "your default text" }}

Here is how the example shortcodes would be modified to insert default text:

{{ subscriber.first_name | default: "there" }}

and

{{ subscriber.company | default: "your company" }}

The filter is separated from the rest of the shortcode by a pipe character. Between the double quotes, insert whatever default text you would like to appear.

Now any subscribers that do not have values for the custom fields will see that same email as:

default-filter-ex

Alternatively, if you have a field that isn’t set on every subscriber, you can use Liquid tags to check whether a subscriber has a value set for a particular field before inserting it:

Hello{% if subscriber.first_name %} {{ subscriber.first_name }}{% endif %},

Since “{{ subscriber.first_name }}” will only be rendered if the subscriber has a “first_name” value set, a subscriber with no first name set will receive this:

if-first-name

 

Capitalization

You might have some subscriber fields that need to be capitalized when displayed in emails. To fix this, you can use the capitalize filter:

{{ subscriber.custom_field_identifier | capitalize }}

That filter will capitalize the outputed data for any field that is not already.

 

Using Subscriber Tags to Dynamically Change Email Text

Typically, tags aren’t inserted directly into emails, but can instead be used in conditionals to display different content for different subscribers based on their tags.

For example, you might have 3 different segments of subscribers tagged according to their business size. Using conditional statements allow you to present the right content to the right subscribers:

{% if subscriber.tags contains "Small Business" %}
Subscribers tagged with "Small Business" will see this content.

{% elsif subscriber.tags contains "Mid-size Business" %}
Subscribers tagged with "Mid-size Business" will see this content.

{% elsif subscriber.tags contains "Enterprise Business" %}
Subscribers tagged with "Enterprise Business" will see this content. 

{% endif %}

Conversely, if you only want to show text if a tag is not present, use this:

{% unless subscriber.tags contains "Customer" %}

Subscribers without the "Customer" tag will see this content.

{% endunless %}

This is useful if you need to include a call to action, but not show it for subscribers who have already converted.


 

Rendering dates and times in emails

Liquid allows you to display dates and times in Drip emails.

A few of the date and time shortcodes bear explanation:

{{ campaign.next_email_send_at }}

In a campaign email, this will insert the date and time at which a subscriber will receive the next email in the campaign. This can be formatted using Liquid date filters.

{{ subscriber.friendly_time_zone }}

This will insert the subscriber’s time zone abbreviation, e.g. PST, GMT, etc.

{{ now }}

This will insert the current time and date from your (the sender’s) time zone. It will look like this: 2017-01-17 18:26:33 +0000

To render it in a M-D-Y format, use this shortcode:

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

It will now appear like this: Tue, Jan 17, 17