-
Outputs, which output HTML.
The syntax for outputs is a variable or value and optional list of filters surrounded by
{{and}}. For example,{{ user.name }}. -
Tags, which control template rendering and implement logic.
The syntax for tags is a tag name and optional arguments surrounded by
{%and%}. For example,{% if user_metadata.lang == 'it' %} Ciao! {% endif %}.
Tags
All phone templates support the following Liquid tags:| Category | Tags |
|---|---|
| Iteration | for, cycle, tablerow |
| Control flow | if, unless, elsif, else, case |
| Variable | assign, increment, decrement |
| File | include, layout |
| Language | raw, comment |
debug tag
To support debugging and development, our custom{% debug %} tag outputs a summary of the template variables available to your template when it was rendered.
Filters
All email templates support the following Liquid filters:| Category | Filters |
|---|---|
| Math | plus, minus, modulo, times, floor, ceil, round, divided_by, abs, at_least, at_most |
| String | append, prepend, capitalize, upcase, downcase, strip, lstrip, rstrip, strip_newlines, split, replace, replace_first, remove, remove_first, truncate, truncatewords |
| HTML/URI | escape, escape_once, url_encode, url_decode, strip_html, newline_to_br |
| Array | slice, map, sort, sort_natural, first, last, join, reverse, size |
| Date | date |
| Misc | default |
General variables
The following variables are available to the Text Message Template field in every phone template. To use untrusted properties in email templates, escape them with theescape filter (for example, {{ user.name | escape }}).
-
connection, the database connection name -
Tenant-related information defined in Tenant Settings:
tenant, which is the raw tenant namefriendly_namesupport_emailsupport_urllogo_urlhome_urlregion
-
The
applicationobject, with access to the standard client properties likeapplication.nameandapplication.metadata -
The following
uservariables:user.name(untrusted)user.nickname(untrusted)user.given_name(untrusted)user.family_name(untrusted)user.picture(untrusted)user.login_countuser.user_metadata(untrusted if containing user-provided information), user attributes that do not impact a user’s core functionality, including user preferencesuser.app_metadata, user attributes that can impact a user’s core functionality, such as how an application functions or what the user can access, including their support plan, security roles, and access control groupsuser.email_verifieduser.emailuser.phone_numberuser.phone_verifieduser.multifactoruser.source_ipuser.countryuser.city
-
The following
clientvariables:nameclientIDmetadata
-
When a user logs in through an Organization, the following additional variables are available:
organization.idorganization.nameorganization.display_nameorganization.metadataorganization.branding.logo_urlorganization.branding.colors.primaryorganization.branding.colors.page_background
-
Multiple variables:
custom_domain.domain, the tenant’s domain namecustom_domain.domain_metadata, the custom domain’s metadata fields (key-value pairs)