Template Tokens: Names, Dates, and CRM Variables
How to use {{contact.greeting}}, {{today}}, {{now}} and other template tokens, and how to show different wording by pipeline stage or tag, plus date maths like {{today + 6 months}} and wording for empty fields like {{key | wording}}.
Template tokens let you inject live CRM data into your messages automatically. Type a token inside double curly braces: {{contact.greeting}}, and TrustPager replaces it with the real value at send time.
Where Tokens Work
All tokens in this guide work across every template surface in TrustPager:
- Automation email and SMS actions
- Manually composed emails (via https://app.trustpager.com/inbox)
- PDF document templates
- Task descriptions
- Outgoing webhook payloads that include rendered content
- Native integration actions (Xero, Slack, and others)
When you're inside a config field that supports tokens, a variable picker appears: click it to browse and insert the exact token path without having to type it manually.
Name Tokens
Three name tokens cover every scenario:
{{contact.display_name}}: full name, trimmed. Renders "Sarah Chen" if they have a surname, or "Sarah" if they don't. No trailing space, no blank. Use this in body copy where you want the full name.{{contact.greeting}}: first name only, always. "Hi {{contact.greeting}}," always renders as "Hi Sarah," regardless of whether a surname exists. Use this for openers and salutations.{{contact.first_name}}: the raw first name field. Identical to{{contact.greeting}}for most purposes, but{{contact.greeting}}is preferred for salutations as the name makes the intent explicit.
What about {{contact.full_name}}? The old token still works and falls back cleanly for first-name-only contacts: if there's no surname it renders just the first name instead of leaving a trailing space. That said, {{contact.display_name}} is recommended for new templates. The name makes the fallback behaviour explicit.
First-Name-Only Contacts
Some contacts only have a first name: think "Cher", or a lead who signed up with just their given name. When you create or edit a contact at https://app.trustpager.com/crm/contacts, leave the Last name field blank. TrustPager stores a null surname: no placeholder, no blank space. The name tokens above handle this cleanly. You can also clear a surname via the API: pass "last_name": null to update_contact.
Date and Time Tokens
Two tokens let you stamp the current date or timestamp at the moment the automation fires:
{{today}}
The current date in your workspace's configured timezone, formatted as YYYY-MM-DD: for example, 2026-04-22.
Use {{today}} for date-only fields such as relationship_started_at or actual_close_date. The value is a clean date string in the workspace timezone, so if you're in Australia/Sydney and it's 8am AEST, you get today's Australian date: not UTC's previous day.
Example: a stage automation on your "Lead Received" stage sets relationship_started_at to {{today}}, so every new lead gets an accurate relationship start date stamped automatically.
{{now}}
The current date and time as a UTC ISO 8601 timestamp: for example, 2026-04-22T08:15:30Z.
Use {{now}} for full timestamp fields (Postgres timestamptz columns). Postgres handles the timezone conversion automatically: the value is stored in UTC and displayed in local time wherever it appears. Do not use {{now}} for date-only fields; use {{today}} instead.
CRM Variable Tokens
Beyond name and date, you can reference almost any field on the contact, opportunity, or account. Common examples:
{{contact.email}}: the contact's primary email address{{contact.phone}}: the contact's phone number{{deal.name}}: the opportunity name{{deal.value}}: the opportunity value{{deal.stage}}: the current pipeline stage name{{account.name}}: the account (customer) name{{account.tax_number}}: the account's tax number (useful in invoicing templates)
Custom Field Tokens
Custom fields are referenced via their field ID in the metadata object:
{{contact.metadata.field_id}}: a custom field on the contact{{deal.metadata.field_id}}: a custom field on the opportunity
To find the exact field ID and token path, open any config field that supports tokens and use the variable picker: it lists every available token with the correct path already formatted.
Date Maths: Shift a Date Forward or Back
Add or take away days, weeks, months or years from a date token. The result is still a calendar date, so it drops straight into a date field.
{{today + 6 months}}: six months from today{{today + 14 days}}: two weeks from today{{deal.metadata.start_date + 2 weeks}}: two weeks after a date field on the opportunity{{today - 1 year}}: the same day last year
Use a plus or minus sign, then a number (up to 4 digits), then a unit. Each unit can be written short or long: d, day, days, w, week, weeks, m, month, months, y, year, years.
Things to know:
- Month ends are clamped to the last day of the month. 31 January plus 1 month gives 28 February (29 in a leap year).
- If the starting field is not a date (empty, or text like "soon"), the token resolves to nothing. In a Set CRM Field step, that step is skipped rather than writing junk.
- A date field stores a proper date and shows it as DD/MM/YYYY. For example,
{{today + 6 months}}run on 18/11/2026 writes 18/05/2027.
The full walkthrough, including a recall reminder example, is at https://trustpager.com/help-center/set-crm-field-automation.
Wording for an Empty Field
If a field might be empty, put a bar and some wording after it: {{key | wording}}. When the field has a value, the value prints. When it is empty or missing, your wording prints instead.
Example: {{deal.metadata.renewal_date | to be agreed}} prints the renewal date when there is one, and "to be agreed" when there is not.
This works in automation text, in document templates (Document Builder), in the signing email subject and intro, and in signer fields. It also combines with date maths: {{deal.metadata.start_date + 1 year | to be agreed}}.
It matters most for documents. A document sent for signing will not send while any merge field is blank, so nobody signs a contract with a hole in it. Giving the field wording to print is the way to let it send. See https://trustpager.com/help-center/send-documents-esigning.
Show Different Wording by Pipeline Stage
You can make one message read differently depending on which pipeline stage the opportunity is in. You write it once, and TrustPager picks the right wording for each lead.
Where it works
- The subject and body of the Send Email, Send Custom Email, Send Gmail Email and Send SMS automation actions
- Booking messages: confirmation, reminders, late, no-show, rebooking and meeting start
The syntax
To show one piece of wording when the opportunity is in a stage, and something else for every other stage:
{{#if opportunity.stage == "Stage Name"}}text when the opportunity is in that stage{{else}}text for any other stage{{/if}}
To flip it around, use !=:
{{#if opportunity.stage != "Stage Name"}}text when it is in any other stage{{else}}text when it is in that stage{{/if}}
Example
{{#if opportunity.stage == "Intro Booked"}}Your intro call is booked.{{else}}Choose a time for your intro call.{{/if}}
A lead in the Intro Booked stage sees "Your intro call is booked." A lead in any other stage sees "Choose a time for your intro call."
The rules
- Type the stage name exactly as it appears in your pipeline. Do not use a stage ID.
- Capital letters do not matter, and extra spaces at the start or end of the name are ignored.
opportunity.pipelineholds the pipeline's name, and you can compare it the same way.- If an opportunity sits on more than one pipeline, TrustPager uses its main placement first, then the oldest placement.
- A booking with no linked opportunity has an empty stage and pipeline. To match that case, use
{{#if opportunity.stage == ""}}. - Your existing
{{#if field}}checks still work, and you can nest blocks or mix the two styles. - In booking messages, placeholders such as
{booker_first_name}and{time}still work inside either side of the block.
Things to know
- The wording is chosen at the moment the message is queued to send. A message already waiting to send keeps the wording it was given when it was queued, even if the opportunity then moves stage.
- If you rename a stage, any block that uses the old name stops matching. Update the block to the new name.
- You type these blocks by hand for now. There is no editor screen for them yet.
Show Different Wording by Tag
You can also switch wording based on the tags on an opportunity. This is handy when one message, or one Auto Sequence, has to serve a lead at different points in their journey and only the call to action changes.
The syntax
Use contains to check whether the opportunity has a tag:
{{#if opportunity.tags contains "Intro booked"}}Your intro call is booked.{{else}}Choose a time for your intro call.{{/if}}
Use !contains for the opposite, when the opportunity does not have the tag:
{{#if opportunity.tags !contains "Intro booked"}}Choose a time for your intro call.{{else}}Your intro call is booked.{{/if}}
The rules
opportunity.tagsis the list of the opportunity's tag names.- The quoted text must match a whole tag. Capital letters do not matter, and extra spaces at the start or end are ignored.
- Part of a tag never matches. "Intro" does not match a tag called "Intro booked".
- Tags are checked at the same moment as the stage: when each Auto Sequence email or automation message is sent, not when the lead joined. A lead who gets a tag on day 6 gets the new wording from their next email. They are not restarted.
- It works wherever
opportunity.stageworks: automation emails (subject and body), automation text messages, booking confirmations and booking reminders.
Three endings in one message
Blocks can sit inside each other, so one message can end three different ways:
{{#if opportunity.tags contains "Signed up"}}Activate your plan{{else}}{{#if opportunity.tags contains "Booked"}}Start your free trial{{else}}Book a call{{/if}}{{/if}}
Someone tagged "Signed up" sees "Activate your plan". Someone tagged "Booked" sees "Start your free trial". Everyone else sees "Book a call".
A typical setup
- Build one Auto Sequence for the lead's whole journey at https://app.trustpager.com/auto/auto-queues, and write the call to action as a tag block like the one above.
- At https://app.trustpager.com/auto/automations, add an automation that uses the Apply Tags action on a real event, such as a booking being made, a form being completed or a quote being paid.
- From then on, every later email picks the ending that matches the tags the opportunity has at that moment.
Tag names are matched as typed, so if you rename a tag, update any block that uses the old name.
Tip: Birthday messages use a separate single-brace syntax ({first_name}) and are not affected by the tokens in this guide: they already handle null surnames cleanly via their own renderer.