Docs › Marketing
Templates and Liquid
A template is the content of a message: the title and text of a push notification, the subject and HTML of an email, the text of an SMS, or the values of an approved WhatsApp template. Messages and journey steps both send templates.
Templates are personalized with Liquid, a small template language: Hi {{ first_name | default: "there" }}! becomes "Hi Dana!" for Dana, and "Hi there!" for someone without a first name. You can also add dynamic content from a CSV (e.g. one text per language) and data feeds (your own API, called for each person at send time).
What you see
The templates list
Marketing → Templates lists your templates with their channel, the start of their content, and when they changed. A template with dynamic content or data feeds says so under its name.
- + New template asks which channel it's for: Web push, Email, SMS or WhatsApp. A template's channel can't be changed later.
- Duplicate makes a copy with everything: its fields, data feeds and dynamic content CSV.
- Delete removes a template, unless a journey or a message that isn't sent yet uses it.
The template editor
The editor has the template's fields on the left and a Preview on the right.
The fields per channel:
| Channel | Fields |
|---|---|
| Web push | Title, Message, Link (opens when clicked), Big image (optional), Icon (optional) |
| Subject, Preview text, From name (optional), HTML | |
| SMS | Text |
| WhatsApp template, then a value for each of its parts |
Under the fields:
- Insert: buttons add common Liquid for you (first name, full name, email, external id, language, country, a tag, if / else). For email there is also an Unsubscribe link button.
- Personalization (Liquid) opens a short reference.
- A character count for push titles and texts. For SMS it also shows how many SMS the text takes (160 characters per SMS, or 70 with special characters such as emoji; longer texts are split into parts of 153 or 67), before personalization.
- A mistake in the Liquid shows under the field straight away, with its line.
A new email template starts with a simple layout you can change. Email programs handle tables and inline style="…" best.
Below the fields are the Dynamic content and Data feeds cards.
Preview and test
The Preview shows the message as it would look: a notification, an email (subject, sender, preview text and the email itself), an SMS bubble, or a WhatsApp bubble with its buttons. It updates as you type.
By default it uses a sample person (Dana Levi, dana@example.com, external id sample-123, language en, country US, no tags). Search a user in Preview as a user to see it with their details and tags. Data feeds are called for real in the preview. If a feed fails, the preview says so: that person would be skipped.
Send a test to a user sends the template now, through the channel, to the chosen person's subscriptions. The template is saved first. The test follows the same rules as a real message: the person must be subscribed, and frequency limits apply.
Click Save template (or press Ctrl+S / Cmd+S) to save. A template with a Liquid mistake can't be saved.
How it works
Personalization variables
Every template sees these values for the person it's sent to:
| Variable | What it is | |
|---|---|---|
first_name, last_name | Their first and last name | |
name | First and last name together | |
email, phone | Their email and phone (with the country code) | |
external_id | Your own id for them | |
language, country, timezone | e.g. en, US, Europe/London | |
tags.NAME | A Marketing tag, e.g. {{ tags.plan }} | |
NAME | Tags are also available directly, e.g. {{ plan }} (the properties above win if a tag has the same name) | |
user | All of the above together, e.g. {{ user.email }}, {{ user.tags.plan }} | |
website.name, website.domain | Your website's name and domain | |
now | The time of sending, e.g. `{{ now | date: "%b %d" }}` |
unsubscribe_url | The person's unsubscribe link | |
message.name, journey.name | The message or journey sending it | |
dynamic_content | Your dynamic content CSV (see below) | |
data_feed.NAME | The answer of a data feed (see below) |
A value that doesn't exist prints nothing. Use default to give a fallback.
Liquid
Output is written with {{ … }}, and logic with {% … %}.
Hi {{ first_name | default: "there" }}!
{% if tags.level > 5 %}You're a VIP.{% elsif tags.plan == "gold" %}Thanks for being Gold.{% else %}Welcome!{% endif %}#### Tags
| Tag | Example | |
|---|---|---|
if, elsif, else, endif | {% if tags.plan == "gold" %}…{% endif %} | |
unless, endunless | {% unless email == blank %}…{% endunless %} | |
case, when, else, endcase | {% case language %}{% when "es" %}Hola{% when "fr", "it" %}Ciao{% else %}Hi{% endcase %} | |
for, else, endfor | {% for item in data_feed.cart.items limit:3 %}{{ item.name }}{% else %}Your cart is empty{% endfor %} | |
break, continue | inside a for loop | |
assign | `{% assign total = data_feed.cart.total | round: 2 %}` |
capture, endcapture | {% capture greeting %}Hi {{ first_name }}{% endcapture %} | |
comment, endcomment | text that isn't shown | |
raw, endraw | shows {{ }} as it is |
for loops take limit:, offset: and reversed, and loop over lists, ranges like (1..5), and objects (each item is a [key, value] pair). Inside a loop, forloop.index, forloop.index0, forloop.first, forloop.last, forloop.length and forloop.rindex are available.
#### Conditions
- Comparisons:
==,!=(or<>),>,<,>=,<=, andcontains(text contains text, or a list contains a value). - Combine with
andandor. Like standard Liquid, they are read from the right:a or b and cmeansa or (b and c). There are no parentheses. - Values: text in quotes, numbers,
true,false,nil(ornull), andemptyorblank({% if tags.plan == blank %}). - A value on its own is true unless it's missing,
nilorfalse. - Tags and CSV values are text, but text that looks like a number compares as a number:
tags.level > 5works when the tag is"7".
Values can be read with dots and brackets: data_feed.cart.items[0].name, dynamic_content.title[language], tags["my-tag"]. Lists also have .size, .first and .last, and a negative index counts from the end (items[-1]).
Add a - to remove the spaces and line breaks next to a tag: {%- if … -%}, {{- name -}}.
#### Filters
Filters change a value: {{ value | filter: argument }}. They can be chained.
| Filters | What they do |
|---|---|
default: "x" | x when the value is missing, empty, false or an empty list |
upcase, downcase, capitalize | Change case (capitalize makes the first letter upper case) |
strip, lstrip, rstrip, strip_newlines | Remove spaces or line breaks |
append: "x", prepend: "x" | Add text after or before |
replace: "a", "b", replace_first: "a", "b" | Replace text |
remove: "a", remove_first: "a" | Remove text |
truncate: 20 | Cut to 20 characters including ... (default 50; a second argument sets the ending) |
truncatewords: 5 | Cut to 5 words, then ... (default 15) |
size | Length of a text or list |
first, last | First or last item (or character) |
join: ", ", split: "," | Join a list into text, or split text into a list |
slice: 2, 3 | Part of a text or list (start, length; a negative start counts from the end) |
plus, minus, times, divided_by, modulo | Arithmetic. divided_by rounds down when both numbers are whole; dividing by 0 gives 0 |
round: 2, ceil, floor, abs | Round a number |
at_least: 1, at_most: 10 | Keep a number within limits |
escape, escape_once | Make text safe inside HTML |
url_encode, url_decode | For values in links |
strip_html, newline_to_br | Remove HTML tags, or turn line breaks into <br /> |
reverse, sort, sort: "key", uniq, compact | Change a list |
map: "key", where: "key", "value", concat: list | Pick, filter or join lists of objects |
json | The value as JSON |
date: "%b %d, %Y" | Format a date (see below) |
date takes a date, a timestamp, or "now" / "today", and formats it in UTC. The format codes are %Y (2026), %y (26), %m (09), %d (05), %e (5), %H (hour, 24h), %I (hour, 12h), %M (minutes), %S (seconds), %p (AM/PM), %b (Sep), %B (September), %a (Mon), %A (Monday), %j (day of the year), %s (seconds since 1970) and %%. Without a format it writes like "Sep 05, 2026".
#### Good to know
- Liquid doesn't make output HTML-safe by itself. In emails, use
| escapefor values people type themselves (like names). - An unknown tag or filter, or a tag that isn't closed, is a mistake: the template can't be saved until it's fixed.
- A list or object printed directly comes out as JSON.
- Very long loops stop, so a template can never run forever.
Dynamic content (CSV)
Dynamic content is one message with different content per person, for example per language or plan. Upload a CSV in the template's Dynamic content card:
- The first row names the columns.
- The first column names each piece of content; the other columns are the variants.
key,en,es
title,Welcome!,¡Bienvenido!
cta,Start now,Empieza ahoraUse it as {{ dynamic_content.title[language] }} (the variant for the person's language) or {{ dynamic_content.title.en }} (a fixed column). Give a fallback for people with another language:
{{ dynamic_content.title[language] | default: dynamic_content.title.en }}Commas or semicolons both work, and values can be in quotes (with commas and line breaks inside). Rows with an empty first column are skipped. The card shows the file name, the number of rows, the columns and the first 20 rows. Replace CSV uploads a new file, and Remove removes it.
Data feeds
A data feed calls your own API for each person just before their message is sent. Its JSON answer is then available as {{ data_feed.NAME… }}, for example their cart, balance or recommendations.
Create feeds in Marketing → Data feeds → + New data feed:
- Name (in templates): letters, numbers and
_, e.g.cart. - Method: GET or POST.
- Address: can use Liquid, e.g.
https://api.example.com/users/{{ external_id }}/cart. - Headers (one per line), e.g.
Authorization: Bearer YOUR_API_TOKEN, and a Body for POST. Both can use Liquid. - Test with a user → Call it calls the feed for a person (or the sample person) and shows the answer.
Then, in the template editor, tick the feeds the template uses in the Data feeds card, and use the answer:
{{ data_feed.cart.items[0].name }}
{% for item in data_feed.cart.items limit:3 %}{{ item.name }} {% endfor %}Rules:
- The call must answer within 5 seconds, with JSON of up to 256 KB. Redirects aren't followed.
- Only public internet addresses can be called.
- If a feed fails for a person (an error, a timeout, a status that isn't 2xx), that person is skipped: the message isn't sent without its data. The results show why.
- Deleting a feed removes it from the templates that used it.
WhatsApp templates
WhatsApp templates are made and approved in Meta's WhatsApp Manager. In Kolvantage, a WhatsApp template chooses one of them and says what goes in its parts:
- Choose it in WhatsApp template. Only approved templates can be chosen; others show with their status. Reload the list fetches them again from Meta.
- Fill each part with Liquid: the header's variable (or, for an image, video or document header, its link), each body variable such as
{{1}}or a named one, and the end of each link button's address.
The preview shows the template's text with each person's values. A person for whom any part comes out empty is skipped, since WhatsApp refuses empty values, so use default. A template with no parts to fill sends everyone the same text.
What happens at send time
For each person, Kolvantage calls the template's data feeds, writes every field with their values, and sends it. A person is skipped when:
- a data feed fails for them;
- the push title and text are both empty, the email subject is empty, or the SMS text is empty, for them;
- a WhatsApp part is empty for them.
Limits
| Field | Up to |
|---|---|
| Push title | 200 characters |
| Push message | 2,000 characters |
| Push link, image, icon | 1,000 characters each |
| Email subject, preview text | 300 characters each |
| Email from name | 100 characters |
| Email HTML | 500,000 characters |
| SMS text | 2,000 characters |
| Dynamic content CSV | 2 MB |
| Data feed answer | 256 KB, within 5 seconds |
| A written message | 1 MB (longer output is cut) |
Who can use it
Everyone with the Marketing tool can see templates and previews. Creating, changing, deleting and test-sending templates, and managing and testing data feeds, needs the Owner, Admin or Manager role.