Liquid and variables
Every email can use Liquid to fill in names, plans, links, and anything else you know about the person. In the email editor, click {x} to pick a variable, or type it.
What you can use
| Variable | What it holds | Where |
|---|---|---|
{{ person.properties.first_name }} | Any person property | Broadcasts and automations |
{{ event.properties.plan }} | A property of the event that started the automation | Automations with an event trigger |
{{ variables.reset_link }} | Values your code sends, or values earlier steps saved | Transactional emails and automations |
{{ unsubscribe_url }} | The person's link to the preferences page | Marketing emails. See unsubscribes. |
A transactional email can't read person properties. Your code sends everything it shows.
Add a default
A property can be missing for some people. Add a default:
Use single quotes inside Liquid. A double quote inside a link's href ends the address early and breaks the link.
Properties that start with $
Use brackets and single quotes:
{{ person.properties.$email }} fails, and the email doesn't send.
Show something to only some people
Wrap it in an if:
In the email editor, you can do the same for a whole block: open Who sees it, pick Show only when…, and fill in Only if.
Filters
Filters change a value before it shows, such as upcase, capitalize, date, and truncate:
PostHog adds a currency filter, which takes a currency code, a locale, or both:
The Liquid docs list the standard filters. PostHog turns off the filters that take an expression, such as where_exp and group_by_exp.
When it goes wrong
| Error | Fix |
|---|---|
TokenizationError: unexpected character | Replace curly quotes, often pasted from a document, with straight single quotes. |
expected "\|" before filter | A property starts with $. Use person.properties['$email']. |
| A blank where a name should be | The person doesn't have the property. Add a default. |
If Liquid doesn't render, the email doesn't send. Before you go live, pick a real person in Preview as, and send yourself a test.
For the size and send limits on each email, see email and automation limits.





