Skip to main content

Use Liquid Templating for Message Personalization

Learn how to use Liquid syntax for advanced personalization and dynamic content

Written by Ira

Liquid templating lets you create personalized messages with advanced logic, such as showing different content based on customer location, using fallback text when data is missing, or formatting dates and prices dynamically. Use Liquid in Email Campaigns, SMS, and Push Notifications.


Before You Begin

  • Liquid templating works in Campaigns and Automation – Email, SMS, and Push Notifications all support Liquid objects and filters.

  • Test personalization before sending – Test emails show raw Liquid tags ([[ contact.first_name ]]). Use Test & Preview in the editor and select a real contact to see personalization populate.

  • Always add fallback values – Use | default: 'text' to avoid blank spaces when contact data is missing.

  • Omnisend uses modified Liquid syntax – Replace Shopify's curly braces {{ }} with square brackets [[ ]].

💡 New to personalization? Start with standard personalization before using Liquid. Liquid is for advanced use-cases.

Overview: What is Liquid

Liquid is an open-source templating language created by Shopify. It lets you insert dynamic content into messages using three elements:

  1. Objects – Variables that output contact or order data ([[ contact.first_name ]])

  2. Tags – Logic and control flow ([% if contact.country == 'France' %])

  3. Filters – Modify output ([[ contact.first_name | capitalize ]])

Omnisend uses a modified version of Liquid:

  • Objects: Use [[ ]] instead of {{ }} - Example: [[ contact.first_name ]]

  • Tags: Use [% %] instead of {% %} - Example: [% if contact.country == 'France' %]

💬 Learn more about Liquid in Shopify's documentation and remember to replace curly braces with square brackets in Omnisend.

Objects

Objects are variables that output dynamic content from contact profiles, orders, or your account settings. Objects are always enclosed in double square brackets.

[[ contact.first_name ]]

Available object groups:

  • Contact properties: [[ contact.variable ]] (name, email, location, custom properties)

  • Account properties: [[ account.variable ]] (store name, website, currency)

  • Order properties: [[ order.variable ]] (order ID, total, items) – Automation Workflows only

  • Cart properties: [[ cart.variable ]] (abandoned cart URL) – Automation Workflows only

  • Date properties: [[ current_date ]] (current day, month, year)

View the full Objects Reference Table below.

Filters

Filters change the output of a Liquid object. Filters are separated by a pipe | symbol.


Example:

[[ 'mywebsite.com/orders/' | append: order.order_id ]]

Common filters:

  • default – Add fallback text when data is missing: [[ contact.first_name | default: 'there' ]]

  • capitalize – Capitalize the first letter: [[ contact.city | capitalize ]]

  • upcase – Convert to uppercase: [[ contact.country | upcase ]]

  • append – Add text to the end: [[ account.website | append: '/sale' ]]

  • date – Format dates: [[ current_date | date:'%B %d, %Y' ]] → "May 13, 2026"

  • vocative – Adjust names to vocative form in supported languages: [[ contact.first_name | vocative ]]

Learn more about Liquid filters in Shopify's documentation – remember to use Omnisend's [[ ]] syntax.

Tags (Automation Only)

Tags create logic and control flow in messages. Tags are enclosed in [% %] braces and produce no visible text.

Example:

[% if contact.first_name %] Hi [[ contact.first_name ]] [% endif %]

⚠️ Tags work only in Automation – not in Campaigns. Learn more about Liquid tags in Shopify's documentation.

Common Use Cases

Here are several helpful common use cases for Liquid syntax:

Personalization

Hi [[ contact.first_name ]], welcome to Omnisend!

Output: "Hi Sarah, welcome to Omnisend!"

💡 Tip: This filter automatically adjusts the name to its vocative form in supported languages, making your messages sound more natural and personal. This can be achieved by using vocative personalization: ​[[ contact.first_name | vocative ]]

Personalization with Fallback

Hi [[ contact.first_name | default: 'there' ]], welcome to Omnisend!

Output (if first name is missing): "Hi there, welcome to Omnisend!"

💡 Why use fallbacks?
If a contact's profile is missing data (e.g., no first name), personalization tags will display blank spaces. Fallbacks prevent this:

  • With fallback: Hi [[ contact.first_name | default: 'there' ]] → "Hi there"

  • Without fallback: Hi [[ contact.first_name ]] → "Hi "

Always add fallbacks to avoid awkward blank spaces.

Variable Insertion in Messages

Insert Liquid variables in:

  • Email subject lines: Don't forget your cart, [[ contact.first_name ]]!

  • Email body text: Your order total: [[ order.total_price ]] [[ order.currency ]]

  • SMS messages: Hi [[ contact.first_name ]], your order #[[ order.order_number ]] shipped!

  • Push notifications: [[ contact.first_name ]], 20% off ends today

  • Button links: [[ account.website ]]/orders/[[ order.order_id ]]

Conditional Logic (Automations Only)

Use conditional statements to show different content based on contact data.

Language Localization

[% if contact.custom_properties.language == 'Spanish' %] Hola [[ contact.first_name ]]! [% elsif contact.custom_properties.language == 'French' %] Bonjour [[ contact.first_name ]]! [% else %] Hi [[ contact.first_name ]]! [% endif %]

Location-Based Content

[% if contact.country == 'UK' or contact.country == 'Ireland' %] Have you visited our newest flagship store in London? [% endif %]

Formatting

Capitalize First Letter

Hi [[ contact.first_name | capitalize ]]

Output: "Hi sarah" → "Hi Sarah"

Append Custom Text

[% assign campaign_destination = '/landing_page.html' %]  [[ account.website | append: campaign_destination ]]

Format Dates

Omnisend © [[ current_date | date:'%Y' ]]

Output: "Omnisend © 2026"

Date format options:

  • %d – Day (13)

  • %A – Day name (Wednesday)

  • %m – Month number (05)

  • %B – Month name (May)

  • %Y – Year (2026

Objects Reference Table

Contact Properties

Dropdown Title

Tag

Value Type

Description

Email

[[ contact.email ]]

string

Contact email

Name

[[ contact.first_name ]]

string

Contact's first name

Surname

[[ contact.last_name ]]

string

Contact's last name

City

[[ contact.city ]]

string

Contact's city

Country

[[ contact.country ]]

string

Contact's country

State

[[ contact.state ]]

string

Contact's state

Postal code

[[ contact.postal_code ]]

string

Contact's postal code

Unsubscribe link

[[ unsubscribe_link ]]

Contact's link to unsubscribe

Preference center link

[[ preference_link ]]

Contact preference link

Custom properties

[[ contact.custom_properties.customPropertyName ]]

object

Contact's custom properties

Phone number

[[ contact.phone_number ]]

string

Contact's phone number

Account Properties

Dropdown Title

Tag

Value Type

Description

Email

[[ contact.email ]]

string

Contact email

Name

[[ contact.first_name ]]

string

Contact's first name

Surname

[[ contact.last_name ]]

string

Contact's last name

City

[[ contact.city ]]

string

Contact's city

Country

[[ contact.country ]]

string

Contact's country

State

[[ contact.state ]]

string

Contact's state

Postal code

[[ contact.postal_code ]]

string

Contact's postal code

Unsubscribe link

[[ unsubscribe_link ]]

Contact's link to unsubscribe

Preference center link

[[ preference_link ]]

Contact preference link

Custom properties

[[ contact.custom_properties.customPropertyName ]]

object

Contact's custom properties

Phone number

[[ contact.phone_number ]]

string

Contact's phone number

Account Properties

Dropdown Title

Tag

Value Type

Description

Name

[[ account.name ]]

string

Account's name

Address

[[ account.address ]]

string

Account's address

City

[[ account.city ]]

string

Account's city

ZIP / Postal code

[[ account.zipCode ]]

string

Account's ZIP / Postal code

Country

[[ account.country ]]

string

Account's country

Website URL

[[ account.website ]]

string

Account's website URL

Time zone

[[ account.timezone ]]

string

Account's timezone

Currency

[[ account.currency ]]

string

Account's currency

Date Properties

Dropdown Title

Tag

Value Type

Description

Current day

[[ current_date | date:'%d' ]]

-

The day on which the action is performed

Current day name

[[ current_date | date:'%A' ]]

-

The day on which the action is performed

Current month

[[ current_date | date:'%m' ]]

-

The month when the action is performed

Current month name

[[ current_date | date:'%B' ]]

-

The month name when the action is performed

Current year

[[ current_date | date:'%Y' ]]

-

The current year when the action is performed

Order Properties (Automation Only)

Dropdown Title

Tag

Value Type

Description

Order ID

[[ order.order_id ]]

string

Order's ID

Order number

[[ order.order_number ]]

int64

Order's number

Order name

[[ order.order_name ]]

string

Order's name

Order date

[[ order.order_date ]]

Date

Date when order is created

Currency

[[ order.currency ]]

string

Order's currency

Total price

[[ order.total_price ]]

int64

Order's sum in total

Subtotal price

[[ order.subtotal_price ]]

int64

Subtotal order's sum

Discount

[[ order.discount ]]

int64

Order's discount

Shipping price

[[ order.shipping_price ]]

int64

Order's shipping price

Order status page URL

[[ order.order_url ]]

string

URL to reach exact order information

Order note

[[ order.note ]]

string

Additional order notes

Billing Address (Automation Only)

Dropdown Title

Tag

Value Type

Description

First name

[[ order.billing_address.first_name ]]

string

Contact's first name provided in billing address

Last name

[[ order.billing_address.last_name ]]

string

Contact's last name provided in billing address

Country

[[ order.billing_address.country ]]

string

Contact's country provided in billing address

Country code

[[ order.billing_address.country_code ]]

string

Contact's country code provided in billing address

State

[[ order.billing_address.state ]]

string

Contact's state provided in billing address

State code

[[ order.billing_address.state_code ]]

string

Contact's state code provided in billing address

City

[[ order.billing_address.city ]]

string

Contact's city provided in billing address

Address 1

[[ order.billing_address.address1 ]]

string

Contact's address (1st line) provided in billing address

Address 2

[[ order.billing_address.address2 ]]

string

Contact's address (2nd line) provided in billing address

ZIP / Postal code

[[ order.billing_address.zip ]]

string

Contact's ZIP / Postal code provided in billing address

Company

[[ order.billing_address.company ]]

string

Contact's company title provided in billing address

Phone

[[ order.billing_address.phone ]]

string

Contact's phone number provided in billing address

Shipping Address (Automation Only)

Dropdown Title

Tag

Value Type

Description

First name

[[ order.shipping_address.first_name ]]

string

Contact's first name provided in shipping address

Last name

[[ order.shipping_address.last_name ]]

string

Contact's last name provided in shipping address

Country

[[ order.shipping_address.country ]]

string

Contact's country provided in shipping address

Country code

[[ order.shipping_address.country_code ]]

string

Contact's country code provided in shipping address

State

[[ order.shipping_address.state ]]

string

Contact's state provided in shipping address

State code

[[ order.shipping_address.state_code ]]

string

Contact's state code provided in shipping address

City

[[ order.shipping_address.city ]]

string

Contact's city provided in shipping address

Address 1

[[ order.shipping_address.address1 ]]

string

Contact's address (1st line) provided in shipping address

Address 2

[[ order.shipping_address.address2 ]]

string

Contact's address (2nd line) provided in shipping address

ZIP / Postal code

[[ order.shipping_address.zip ]]

string

Contact's ZIP / Postal code provided in shipping address

Company

[[ order.shipping_address.company ]]

string

Contact's company title provided in shipping address

Phone

[[ order.shipping_address.phone ]]

string

Contact's phone number provided in shipping address

Cart Properties (Automation Only)

Dropdown Title

Tag

Value Type

Description

Abandoned cart URL

[[ abandoned_cart.recover_url ]]

string

URL to reach/recover abandoned cart

Troubleshooting

Personalization shows raw code in emails

Cause: You're viewing a test email instead of a live email.

Solution: Test emails always show raw Liquid tags ([[ contact.first_name ]]). To test personalization:

  • Use Test & Preview in the editor and select a real contact.

  • Or send the campaign/automation live to your own email (ensure your contact profile has data).

Personalization doesn't transform in live emails

Cause: The Liquid tag may have lost integrity if edited partially.

Solution: Delete the entire personalization tag and reinsert it using the Personalization tag menu in the editor.

Fallback text doesn't work

Cause: Incorrect syntax or missing quotes.

Solution: Ensure fallback values are wrapped in quotes:

  • [[ contact.first_name | default: 'there' ]]

  • [[ contact.first_name | default: there ]]

Conditional logic doesn't work in Campaigns

Cause: Tags and conditional statements work only in Automation Workflows.

Solution: Use conditional logic in automations – not Campaigns.


FAQ

Can I use Liquid in SMS and Push Notifications?

Yes. Liquid objects and filters work in Email, SMS, and Push Notifications. Conditional logic works only in Automation.

What's the difference between {{ }} and [[ ]]?

Shopify uses {{ }} for Liquid objects. Omnisend uses [[ ]]. If you're copying Liquid code from Shopify documentation, replace curly braces with square brackets.

Do I need to add fallback values?

Yes. Always add fallbacks to avoid blank spaces when contact data is missing:
[[ contact.first_name | default: 'there' ]]

Can I combine multiple filters?

Yes. Chain filters with | symbols:
[[ contact.first_name | capitalize | default: 'there' ]]

Where can I find more Liquid examples?

Learn more in Shopify's Liquid documentation – remember to replace {{ }} with [[ ]] and {% %} with [% %] in Omnisend.


You are welcome to contact our award-winning Support Team for any additional assistance through the in-app chat or at [email protected].

Did this answer your question?