Developers

Guide

Personalization and Liquid tags

Print any contact, custom or Stripe field in an email, format it, and show parts of an email only to some people, with a safe subset of Liquid.

HelpWell emails can greet each reader by name, print their own fields, and show parts of an email only to some people. You write this with Liquid, the template language Shopify made popular and tools such as Gist use. HelpWell runs its own small, sandboxed version of it: the subset below, with the recipient's fields as its only data.

Personalization works in newsletters and journey emails, in:

  • the subject (and subject B of a subject test) and the preview text;
  • every block in Write mode, and the whole body in HTML mode;
  • the plain-text part, which is made from the personalized body;
  • survey questions, labels and follow-up questions.

The quickest way in is the composer's Personalize panel: the quick fields, More fields (every field this workspace has, in plain words), the If / else block, and a few snippets. Everything it inserts is ordinary Liquid you can also type yourself.

#Printing a field

Hi {{ first_name }},
Your plan: {{ contact.stripe.plan | default: "Free" }}

{{ … }} prints a value. Every value is escaped, so a name such as <b>Ada</b> prints as text, never as markup, and a value is never read as Liquid a second time.

A field the contact does not have prints nothing. Add a fallback with default:

{{ company | default: "your team" }}

#Variables

VariableWhat it is
first_nameThe first word of the contact's name. Empty: "there".
companyThe company field, otherwise the enriched company name. Empty: "your company".
planThe plan field, otherwise the Stripe plan. Empty: "your plan".
last_articleThe last_article field your app sends. Empty: "our help center".
trial_endstrial_ends or trial_end, otherwise the Stripe trial end, as "Oct 3, 2026". Empty: "your trial end date".
subscription_statusThe Stripe subscription status in words: active, trialing, past due, cancelled. Empty: "your subscription".
customer_sinceWhen they became a Stripe customer, as "Oct 3, 2026". Empty: "the start".
contact.first_name, contact.last_name, contact.nameThe contact's name, without built-in fallbacks.
contact.emailThe contact's email address.
contact.company, contact.planAs company and plan, without built-in fallbacks.
contact.tagsThe contact's tags, a list.
contact.segmentsThe names of the saved segments the contact is in, a list.
contact.sourceWhere the contact signed up.
contact.custom.<key>One of your own fields, such as contact.custom.seats.
contact.<key> and <key>The same field, shorter: {{ seats }}.
contact.stripe.<key>Billing fields from your Stripe connection (below).
workspace.nameYour workspace's name.
unsubscribe_urlThe recipient's own unsubscribe link. Previews have none.

The seven short names at the top are HelpWell's original merge tags and keep their built-in fallbacks. Every other variable prints nothing when it is empty.

Your own fields are the ones in Settings → Fields and events: anything your app, a form or an import has added to a contact, and fields you created there. Each field that can be printed shows its merge tag there; click it to copy. Enriched fields (lf_*) and the ICP score are not available in email.

#How values print

A field prints according to its type: the type you locked in Settings → Fields and events, or otherwise the one its value suggests.

TypePrints
DateOct 6, 2026 (UTC)
Number12,500
Money1,234.50 (add money for a currency symbol)
Yes or noYes or No
Lista, b, c
TextAs it is

Numeric text, such as a postcode, stays text unless you lock the field as a number.

#Stripe fields

VariablePrints
{{ contact.stripe.products }}Plan / product: as Stripe has it, such as active
{{ contact.stripe.status }}Subscription status: as Stripe has it, such as active
{{ contact.stripe.mrr }}MRR: in its currency, such as $49.00
{{ contact.stripe.lifetime_value }}Total revenue paid: in its currency, such as $49.00
{{ contact.stripe.products_active }}Products with an active subscription: as Stripe has it, such as active
{{ contact.stripe.products_trialing }}Products with a trialing subscription: as Stripe has it, such as active
{{ contact.stripe.products_past_due }}Products with a past-due subscription: as Stripe has it, such as active
{{ contact.stripe.products_canceled }}Products with a cancelled subscription: as Stripe has it, such as active
{{ contact.stripe.all_products }}Products ever subscribed: as Stripe has it, such as active
{{ contact.stripe.product_history }}Product history: as Stripe has it, such as active
{{ contact.stripe.country }}Country: as Stripe has it, such as active
{{ contact.stripe.customer_since }}Customer since: a date, such as Oct 6, 2026
{{ contact.stripe.current_period_end }}Current period ends: a date, such as Oct 6, 2026
{{ contact.stripe.cancel_at_period_end }}Cancels at period end: Yes or No
{{ contact.stripe.trial_end }}Trial ends: a date, such as Oct 6, 2026
{{ contact.stripe.last_payment_at }}Last payment: a date, such as Oct 6, 2026
{{ contact.stripe.last_payment_amount }}Last payment amount: in its currency, such as $49.00
{{ contact.stripe.currency }}Currency: as Stripe has it, such as active
{{ contact.stripe.discount }}Coupon or discount: as it is
{{ contact.stripe.customer_id }}Stripe customer ID: as it is
{{ contact.stripe.delinquent }}Delinquent: Yes or No
{{ contact.stripe.interval }}Billing interval: as Stripe has it, such as active
{{ contact.stripe.plan }}Plan name: as it is
{{ contact.stripe.amount }}Price: in its currency, such as $49.00
{{ contact.stripe.quantity }}Quantity: a number, such as 3
{{ contact.stripe.subscription_started_at }}Subscription started: a date, such as Oct 6, 2026
{{ contact.stripe.canceled_at }}Cancelled at: a date, such as Oct 6, 2026
{{ contact.stripe.last_invoice_status }}Last invoice status: as Stripe has it, such as active
{{ contact.stripe.last_invoice_amount }}Last invoice amount: in its currency, such as $49.00
{{ contact.stripe.last_payment_failed_at }}Last failed payment: a date, such as Oct 6, 2026
{{ contact.stripe.last_checkout_at }}Last checkout: a date, such as Oct 6, 2026
{{ contact.stripe.last_checkout_amount }}Last checkout amount: in its currency, such as $49.00
{{ contact.stripe.last_refund_at }}Last refund: a date, such as Oct 6, 2026
{{ contact.stripe.last_refund_amount }}Last refund amount: in its currency, such as $49.00

Stripe keeps amounts in cents, and HelpWell knows it: {{ contact.stripe.amount }} and {{ contact.stripe.amount | money }} both print $49.00 for 4900. Conditions compare the stored number, so compare amounts in cents: {% if contact.stripe.amount > 4000 %}. The camelCase names Stripe uses (trialEnd, cancelAtPeriodEnd) work too.

#Filters

A filter changes a value: {{ value | filter: argument, argument }}. Filters can be chained.

FilterExamplePrints
default`{{ company \default: "your team" }}`The value, or the fallback when it is empty
capitalize`{{ "hello WORLD" \capitalize }}`Hello world
upcase`{{ first_name \upcase }}`ADA
downcase`{{ first_name \downcase }}`ada
date`{{ contact.stripe.trial_end \date: "%b %-d, %Y" }}`Oct 3, 2026
truncate`{{ contact.custom.bio \truncate: 40 }}`The first 40 characters, with "..."
money`{{ contact.custom.budget \money }}`$1,234.50
money with a currency`{{ contact.custom.budget \money: "EUR" }}`€1,234.50
money_cents`{{ contact.custom.credit_cents \money_cents }}`$12.50 for 1250
join`{{ contact.tags \join: " · " }}`vip · beta
size`{{ contact.tags \size }}`2
append, prepend`{{ first_name \append: "!" }}`Ada!
plus, minus`{{ contact.custom.seats \plus: 1 }}`13

date reads ISO dates (2026-10-06, 2026-10-06T09:30:00Z), Unix seconds or milliseconds, and "now". Dates are in UTC. Its format uses these codes:

CodePrintsCodePrints
%Y2026%H09 (24-hour)
%y26%I09 (12-hour)
%m10%M30
%d06%S05
%-d, %e6%pAM or PM
%BOctober%ATuesday
%bOct%aTue
%F2026-10-06%jDay of the year

Without a format, date prints "Oct 6, 2026".

#Showing parts to some people

{% if contact.tags contains "vip" %}
Your VIP perks are ready.
{% elsif contact.segments contains "Active customers" %}
Thanks for being a customer.
{% else %}
Here is what you are missing.
{% endif %}
  • if, elsif, else and endif, and unless … endunless for the opposite.
  • Compare with ==, !=, >, <, >=, <= and contains. Join conditions with and and

or; as in Liquid, they are read from right to left.

  • contains works on lists (tags, segments, list fields) and on text.
  • Text comparisons ignore upper and lower case, like conditions everywhere else in HelpWell: tag

VIP matches "vip".

  • A missing field, empty text and an empty list are false. Compare with blank or empty to test

for them explicitly: {% if contact.company == blank %}.

  • Values: text in single or double quotes, numbers, true, false and nil.

case picks one of several:

{% case contact.stripe.status %}
  {% when "active", "trialing" %}Thanks for being a customer.
  {% when "canceled" %}We would love to have you back.
  {% else %}Take a look at our plans.
{% endcase %}

In Write mode, put each {% if %}, {% else %} and {% endif %} in its own paragraph. A paragraph that holds nothing but tags disappears when the email is sent, so a branch never leaves an empty line behind. Or use the If / else block: pick a field (Tag, Segment, Subscription status, Plan, or any contact, custom or Stripe field), a condition that suits it ("has", "is in", "is more than", "is yes") and a value from the ones your contacts have (or type one), and HelpWell shows the block as "Shown when the contact has the tag VIP" with an "Otherwise" part, and writes the Liquid underneath. A paragraph you typed as {% if … %} can be turned into the block from its settings.

Preview shows the email as a chosen contact. A field that prints nothing for them is marked in the preview and listed under Empty for this contact, with a suggested fallback: Add fallback turns {{ contact.stripe.plan }} into {{ contact.stripe.plan | default: "your plan" }} everywhere in the email.

#Loops and variables

{% for tag in contact.tags limit: 3 %}
  {{ forloop.index }}. {{ tag }}{% unless forloop.last %},{% endunless %}
{% else %}
  No tags yet.
{% endfor %}

{% assign greeting = first_name | default: "friend" | capitalize %}
Hello {{ greeting }}!

for takes limit:, offset: and reversed, a range such as (1..5), break and continue, and an else for an empty list. forloop.index, index0, first, last and length describe the loop. {% raw %}…{% endraw %} prints Liquid as written, and {% comment %}…{% endcomment %} is left out. {%- and -%} trim the whitespace next to a tag.

An output can be a whole link, such as the button or link address {{ unsubscribe_url }} or {{ contact.custom.dashboard_url }}. HelpWell keeps it only when it prints an http, https or mailto address; anything else leaves the link without an address. An image address may also be one whole output, such as a personal countdown image {{ contact.custom.countdown_url }}, kept only when it prints an http or https address. Liquid inside part of a link, part of an image address or a style is not run: it is sent as written, and the pre-flight warns you.

#The original merge tags

Emails written before Liquid keep working exactly as they did:

{{first_name}}  {{ first_name | there }}  {{company | your team}}

A bar followed by text that is not a filter name, such as | your team, is fallback text: it reads as default: "your team". The original tags keep their built-in fallbacks when you do not give one, and are recognized in any case ({{FIRST_NAME}}). Other tools' tags, such as Mailchimp's *|FNAME|*, are not personalization: they are sent as typed, and the pre-flight warns you. Importing HTML turns other tools' first-name tags into {{first_name}} and keeps HelpWell's own Liquid as written.

#Limits

Personalization is a sandbox. It cannot read files, include other templates or layouts (include, render and layout are not available), or reach anything but the recipient's variables. To keep every send fast and safe:

LimitValue
Template length1,000,000 characters (the whole body counts as one)
Blocks inside one another20
Items one loop goes through100 (the rest are skipped, as with limit: 100)
Loop iterations in one email1,000
assign runs in one email1,000
What outputs and loops can add512 KB
One printed value1,000 characters, on one line

A template that is too long or nests blocks too deeply is a problem the checks report. When an email is rendered (a preview, a test or a send), a loop or value that goes over a limit prints nothing and the rest of the email goes out; a recipient never sees raw {{ or {%.

#Preview and checks

  • As you type, the composer lists personalization problems under the preview text and outlines

the block they are in, in plain words: "This {% if %} is missing its {% endif %}.", "Unknown field “pln” in {{ pln }}. Did you mean “plan”?".

  • Preview shows the email as a contact would get it. Search for a contact by name or email,

or switch on the tags, segments and subscription status the email checks, and the subject, preview text and body change with them. Previewing sends nothing.

  • The pre-flight (Send or schedule, and the Checks panel) blocks sending while any

personalization does not parse, and says where: the subject, the preview text, the block, or the line in HTML mode. It warns about fields no contact in the workspace has (with a likely correction), other tools' merge tags, and Liquid inside links, image addresses or styles.

  • Scheduling a newsletter and Mark ready for a journey email refuse an email whose

personalization does not parse, whatever client sends the request.

#For AI assistants

The composer's Agent Instruction button next to Personalize copies a prompt for ChatGPT, Claude or a coding agent: this subset of Liquid, the variables in your workspace (keys and labels only, never a contact's values) and examples, so an assistant writes personalized emails that pass the checks.