Advanced Personalization
What is Liquid Templating and Why Use It?
Liquid templating language enables you to create highly personalized emails by dynamically inserting information specific to each recipient. This helps your outbound campaigns feel more relevant and engaging, increasing the chances of a positive response. Using Liquid, you can customize dates, greetings, and other content elements without manually editing each email.
Getting Started with Liquid Templates
Liquid templates use placeholders wrapped in double curly braces {{ }} to insert dynamic content. You can also assign variables to reuse values throughout your email.
Basic Examples
Here are some simple examples to get you started:
- Insert the current date:
Today is {{ "now" | date: "%B %d, %Y" }}.This will output:
Today is November 03, 2025. (assuming today is November 3, 2025)
- Assign and use a variable:
{% assign default_placeholder = "Peter" %}
Hello {{ default_placeholder }}!This outputs:
Hello Peter!
How to Assign Variables
You can assign variables to store values and reuse them later in your template. Assignments are done using {% assign variable_name = value %} and are not displayed in the final email.
For example:
{% assign greeting = "Hey there" %}
{{ greeting }}, We saw that you might be interested in this solution.Outputs:
Hey there, We saw that you might be interested in this solution.
Advanced Liquid Templating for Date and Time
Liquid lets you manipulate dates and times, which is useful for scheduling or referencing future events dynamically.
Using Next Business Day and Timezones
You can calculate the next business day with a delay and format it according to your campaign’s timezone:
{{ "now" | next_business_day: 2 | date: "%A, %B %-d, %Y, %-I:%M %p" }}This outputs the date and time two business days from now. If you replace "now" with any ISO 8601 timestamp, it will calculate based on that time and your campaign’s timezone.
Example with a fixed timestamp:
{{ "2026-11-03T15:28:10+01:00" | next_business_day: 2 | date: "%A, %B %-d, %Y, %-I:%M %p" }}This would output the next business day two days after November 3, 2026, 3:28 PM in Berlin time.
Assigning and Formatting Variables
You can assign these calculated dates to variables and format them for your recipients’ timezone:
- Assign the appointment time one business day from now:
{% assign appointment_datetime = "now" | next_business_day: 1 %}- Assign the recipient’s timezone:
{% assign recipient_timezone = "America/Denver" %}- Use the variables to format the date in the email:
Would {{ appointment_datetime | date: "%A, %B %-d, %-I:%M %p", recipient_timezone }} work for your schedule?This outputs a natural, readable date and time adjusted to the recipient’s timezone.
Tips for Using Liquid Templates Effectively
Using Liquid templates effectively can greatly enhance your email personalization. Here are some best practices:
-
Combine Spintax and Liquid: You can mix both to generate varied and personalized emails without manual edits.
-
Preview Before Sending: Always preview your emails to ensure the dynamic content renders correctly and looks natural.
-
Use Clear Variable Names: Assign descriptive variable names to keep your templates easy to understand and maintain.
-
Test Timezone Conversions: If you use timezone conversions, test with different recipient timezones to avoid confusion.
-
Leverage Date Formatting: Customize date and time formats to match your audience’s preferences or locale.
Common Liquid Filters for Dates
date: "%B %d, %Y"— Formats a date as “Month day, Year” (e.g., November 3, 2025)next_business_day: n— Calculates the next business day with a delay of n days- Timezone conversion by passing the timezone string as a second argument to the
datefilter
Using Liquid templating can save you hours of manual personalization while increasing email relevance.
Troubleshooting and Use Cases
Different use cases might require slight variations in Liquid syntax or setup. Here’s a quick guide to common scenarios:
Basic Date
Use {{ "now" | date: "%B %d, %Y" }} to insert the current date in your email.
Define What You Want to Personalize
Decide which parts of your email should change dynamically, such as dates, names, or appointment times.
Write and Assign Variables
Use Liquid syntax to assign variables and insert placeholders where needed.
Preview and Test Your Email
Always preview your email with sample data to verify that Liquid expressions render correctly.