Skip to content
WeZend

Campaigns & content

Liquid in templates: if, for and filters

Write conditions, loops and filters in campaigns and journey messages. A template that does not parse is blocked before anything is sent.

You can write Liquid in the text of a campaign (subject, e-mail blocks, SMS, A/B variant, backup message) and in a journey message step:

{% if plan == 'pro' %}Thanks for being a Pro customer{% else %}Try Pro free for 14 days{% endif %}, {{ first_name | capitalize }}.
{% for c in object_lists.company %}{{ c.name }}{% unless forloop.last %}, {% endunless %}{% endfor %}

{% if %}, {% for %}, {% assign %}, {% case %} and filters are supported.

Values you can use

first_name, last_name, email, every custom field, customer.<field> (the same values), and in a journey the trigger event's properties as event.<name> and its store tags. A contact's objects are objects.<type> (the first) and object_lists.<type> (all, for a loop).

Existing templates are unchanged

A text with only plain tags such as {{first_name}} is filled in exactly as before and never reaches the Liquid engine. Liquid is used only when a text contains {% … %} or a {{ … }} with a filter, property, index or string. System tags such as {{unsubscribe_link}} are handled separately and cannot be used inside {% if %}.

What is locked

  • include, render, layout and block are removed.
  • Printed values are HTML-escaped; the raw filter does nothing.
  • Render time, memory and template size are limited, so a runaway loop ends in an error.

Errors never go out

A template that does not parse would render as an empty message, so it is blocked: a campaign fails the pre-flight with template_syntax, and a journey cannot be activated (liquid_syntax). POST /v1/liquid/check with { "texts": [ … ] } (up to 20 texts) parses without sending or reading anything and returns ok or an error for each; the journey step editor and the SMS composer use it while you type. Reusable text belongs in snippets.

One platform. Every customer interaction.

Replace your patchwork of messaging APIs, CDP and automation tools with a single engagement platform built for scale.

No credit card required · EU data residency · 99.99% uptime SLA