Documentation
Website
  • Getting Started
  • Customer Journey
    • Creating Customer Journey
    • Understanding the Journey
    • Performance Dashboard
    • Pre-built Templates
  • Channels
    • Mobile Push
    • Web Push
    • In-App Message
    • SMS/LMS
    • Webhook
  • Audience
    • Segments
    • Device Management
  • Engagement Tools
    • Dashboard
    • Message Personalization (Liquid)
    • Template
    • Sending Test Messages
    • AI Messaging
    • API Templates
    • Rate Limiting
    • Frequency Capping
    • Tracking Events
    • Inviting Members
  • Data Integration
    • User ID
    • Events
    • Tags
    • Integrating Google Tag Manager
    • Integrating Amplitude
    • Integrating Mixpanel
  • Guide for Developers
    • Mobile SDK Setup
      • Android SDK Setup
      • iOS SDK Setup
      • React Native SDK Setup
      • Flutter SDK Setup
      • Additional Setup
        • Android: FCM Setup (v1)
        • Android: Notification Icons
        • iOS: APNS Setup
        • iOS: Disable Swizzling
    • Web SDK Setup
    • REST API Reference
    • Mobile SDK Reference
    • Web SDK Reference
Powered by GitBook
On this page
  • How It Works
  • Supported Filters
  • String Filters
  • Number Filters
  • Array Filters
  • Conditional Branching
  • Available Variables
  1. Engagement Tools

Message Personalization (Liquid)

PreviousDashboardNextTemplate

Last updated 4 days ago

such as tags or user profiles must come first in order to enable the use of personalized messages based on that data.

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.

How It Works

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:

{{ name | default: "Customer" }}, hello!
John, hello!

If the name data is missing, the default value will be used, and the message will be delivered as:

Customer, hello!

Supported Filters

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" }}.

String Filters

Number Filters

  • number_with_delimiter – Converts a number into a string with comma separators every three digits.

Array Filters

Conditional Branching

Example:

{% assign user_name = tags.nickname %}
{% assign last_purchase = tags.last_purchase_category %}

{% if last_purchase == "Sneakers" %}
This week only, we’re offering 10% off the latest sneakers that {{ user_name }} loves! Don’t miss out 👟
{% elsif last_purchase == "Outerwear" %}
New outerwear perfect for the cold weather has arrived! Special perks are ready just for you, {{ user_name }} đź§Ą
{% else %}
New arrivals and exclusive discounts are waiting just for you, {{ user_name }}. Check them out now!
{% endif %}

Available Variables

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.

API

POST https://api.flarelane.com/v1/projects/<project-id>/notifications
{
  targetType: userId,
  targetIds: "USER_ID",
  body: "{{ writerName }}likes your post."
  data: {
    writerName: "johndoe"
  } 
}
Personalized Messaging (Before Update)

In the message title or body, you can insert double curly braces ({{ }}) and use two vertical bars (||) to separate the variable name from its default value. If the variable has no value, the default value will be used. For example:

For example, if the userName variable contains the value "johndoe", the message will display as "johndoe". If no value is provided, the default "Customer" will be used instead.

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.

user profile
default
truncate
truncatewords
replace
replace_first
date
here
upcase
downcase
capitalize
url_encode
url_decode
strip_html
plus
minus
times
divided_by
round
floor
ceil
first
last
size
join
{% if %} {% else %} {% elsif %}
{% assign %}
tags set in the user profile
event
Integration of customer data
Liquid
You can set up personalization variables with just a few clicks—no need to enter them manually.
Image by FlareLane