Message Personalization (Liquid)
Last updated
Last updated
is an open-source template language developed by Shopify. FlareLane supports personalized messages using Liquid. With Liquid, you can manipulate data into the desired format, enabling richer and more flexible personalization in your messages.
Try adding customer data such as names or membership levels to your messages to deliver a more personalized experience. This often leads to higher engagement compared to generic messages.
Examples of personalized messages:
Hello {{ name | default: "Customer" }}!
Your registration was completed on {{ tags.signup_date | date: "%Y-%m-%d", "America/Los_Angeles" }}.
The product you ordered, {{ entry_event.data.product_name | truncate: 20 }}, has been shipped.
Your reward points of {{ tags.point | number_with_delimiter }} USD are about to expire.
The Liquid syntax is a string block enclosed in double curly braces. For example, a personalized message using the customer’s name can be written as:
If the name data is missing, the default value will be used, and the message will be delivered as:
Filters can be chained together. In the example below, if the signup_date
tag exists, it is formatted as a date. If the value is missing, the default
filter returns a fallback value:
Your registration was completed on {{ tags.signup_date | date: "%Y-%m-%d", "America/Los_Angeles" | default: "today" }}.
number_with_delimiter
– Converts a number into a string with comma separators every three digits.
You can use various integrated customer data as variables in your messages:
Tags: tags.*
Example:
{{ tags.grade }}
– A coupon for your {{ tags.grade }} membership level has been issued.
→ Looks up the grade
tag among the user's tags.
Events: entry_event.data.*
Example:
The item {{ entry_event.data.product_name }} in your cart is still waiting for you!
→ Retrieves product_name
from the event’s attached data.
UserId
If the target device has a user ID, the value is passed. This is often used when user IDs need to be included in webhook calls or similar use cases.
Data
You can inject external values at the time of sending to personalize messages.
Example:
{{ writerName }} liked your post.
→ The value of writerName
can be added via the data
parameter in the API or entered manually in the console.
At the time of sending, if the contains a name value, the message will be delivered like this:
– Replaces a missing variable with a default value.
– Truncates a long string to a specified length.
– Truncates a long string by the number of words.
– Replaces all occurrences of a specific substring in the variable.
– Replaces only the first occurrence of a specific substring.
– Formats a date string to the desired format (Check available formats ).
– Converts all characters in a string to uppercase.
– Converts all characters in a string to lowercase.
– Capitalizes the first word in a string.
– Encodes a string to be URL-safe.
– Decodes a URL-encoded string.
– Removes all HTML tags from a string.
– Adds a specific value to a number variable.
– Subtracts a specific value from a number variable.
– Multiplies a number variable by a specific value.
– Divides a number variable by a specific value.
– Rounds a number to the nearest integer.
– Rounds a number down to the nearest whole number.
– Rounds a number up to the nearest whole number.
– Returns the first value in the array.
– Returns the last value in the array.
– Returns the number of items in the array.
– Combines all values in the array into a single string.
– Used to handle conditional logic and create branching flows based on specific conditions.
– Assigns a value to a temporary variable, which can be reused in later expressions or filters.
Automatically maps to matching or device.
Variables attached to the trigger in customer journey automation can be used in messages.