Liquid personalization tags
This article covers a complete list of supported Liquid personalization tags.
Supported personalization tags
We've prepared a brief overview of the supported personalization tags to make things easier. If you'd like more in-depth information about each type of tag and the recommended practices, please keep reading.
Contact Attributes Tags
In the Contact scope of Naxai, you use Contact attributes, which are data directly linked to an individual. You might find it beneficial to employ Contact attributes within an if
conditional statement. This way, you can provide alternative text if a contact lacks the specific attribute you refer to.
Tags and Attributes are case sensitive.
if your attribute is named firstname then calling contact.FirstName will produce an empty value (blank).
{{ contact.<attribute>}}
{% if contact.firstname != blank %}
Hi {{contact.firstname | capitalize}}
{% else %}
Hi
{%endif%}
Please refer to the Contact Attributes section for more information.
Reserved Attributes Tags |
---|
{{ contact.nxId }} |
{{ contact.email }} |
{{ contact.phone }} |
{{ contact.externalId }} |
{{ contact.smsCapable }} |
{{ contact.createdAt }} |
{{ contact.createdAtNaxai }} |
{{ contact.unsubscribed }} |
{{ contact.language }} |
Custom Attributes Tags |
---|
{{ contact.<attributeName> }} |
Campaign Tags
Campaign tags are used within the context of Campaigns.
{{ campaign.id }}
can be useful as UTM parameters in links, so you can log where your traffic is coming from.
Campaign Tags |
---|
{{ campaign.id }} |
{{ campaign.name }} |
Survey Tags
Survey Tags are used within the scope of a Survey.
{{ survey.data.attribute}}
can be used to personalize the survey with dynamic values.
Survey Tags |
---|
{{ survey.id }} |
{{ survey.name }} |
{{ survey.description }} |
{{ survey.type }} |
{{ survey.score }} |
{{ survey.feedbackText }} |
{{ survey.extraQuestion }} |
{{survey.shortUrl}} |
{{ survey.data.<attribute> }} |
{{ survey.extraQuestion }}
is an array of extra questions containing the following properties: name
, type
, value
and response
You answer is {{ survey.extraQuestion[0].response }}
{{ survey.data.<attribute> }}
is used to attach specific data to the survey sent to your contact, allowing a greater personalization.
How do you rate your interaction with {{survey.data.agent.name | capitalize}}?
Event Tags
When initiating a campaign through an event trigger, you can access properties associated with the triggering event within the event scope. Incorporating event properties within an if
conditional statement can be advantageous. This allows you to provide an alternative text option if the event lacks the specified property or doesn't contain the expected value.
Event Tags |
---|
{{ event.name }} |
{{ event.data.<property> }} |
{% if event.data.unpaidBills > 0 %}
You have unpaid {{ event.data.unpaidBills }} bills.
{%endif%}
Trigger Tags
When sending an API-triggered SMS broadcast, you refer to properties originating from the triggering event using the trigger Tag.
Trigger Tags |
---|
{{ trigger.data.<property> }} |
Hi, {{ contact.firstname }} !
It’s time for your {{ trigger.data.maintenanceType}} appointment on {{ trigger.data.date}} at {{ trigger.data.time}}.
Managing Unsubscribe
Unsubscribe links are used to keep your audience list clean when using campaigns and surveys.
Renders a unique unsubscribe link for a contact and their email address.
Campaign and Survey Unsubscribe Tags |
---|
{{ unsubscribeUrl }} |
{{ unsubscribeShortUrl }} |
{{ unsubscribe }} |
When using Transactional Email API, you can add the global unsubscribe link by using the{{ global-unsubscribe-url }}
Variable Tags
assign
You can use the assign tag to create a variable. After you create a variable, you can reference that variable in your messaging logic or messages.
Using assign
is convenient when performing math operations, manipulating dates, and more.
{% assign currentDate = 'now' | date: '%s' %}
{% assign trialEnd = contact.trialEndDate %}
Your trial will end in {{ trialEnd | minus: currentDate | divided_by: 86400 }} days.
{% assign newLoyaltyPoints = {{contact.points | plus: 10}} %}
Order today to reach {{newLoyaltyPoints}} points!
capture
Captures contents and assigns them to a variable.
{% capture my_variable %}I am being captured.{% endcapture %}
{{ my_variable }}
I am being captured.
Template Tags
comment
Allows you to leave un-rendered code inside a Liquid template. Any text within the opening and closing comment blocks will not be printed, and any Liquid code within will not be executed.
{% comment %} Don't show me! {% endcomment %}
raw
Temporarily disables Liquid processing. You might use this to escape tag processing if you use a conflicting syntax or you want to show raw liquid syntax in your message."
{% raw %}
{{This}} is displayed exactly as typed.
{% endraw %}
Updated over 1 year ago