Templates & merge fields
How a template becomes a letter, and every field you can merge.
The format
A template is Markdown (with tables, lists and bold) and merge fields in double braces. Text in [square brackets] in the built-ins is guidance for whoever adapts the template; remove it from your copy.
# Offer of employment
{{today}}
Dear {{person.first_name}},
We are delighted to offer you the position of **{{person.title}}** at **{{entity.legal_name}}**,
reporting to {{manager.full_name}}. Your anticipated start date is **{{person.start_date}}**.
Please sign below by **{{values.respond_by}}** to accept.Merge fields
| Field | From |
|---|---|
person.full_name, person.first_name, person.last_name | The person (first name uses the preferred name when set) |
person.title, person.department, person.work_location, person.email, person.kind | The person |
person.start_date, person.end_date | The person, in the date format from Settings |
manager.full_name, manager.title | The person’s manager |
entity.legal_name, entity.name, entity.address, entity.country | The person’s legal entity (or the country’s default) |
entity.signatory_name, entity.signatory_title | The entity’s signatory |
comp.amount, comp.currency, comp.period | The person’s pay: amount with thousands separators, currency, and year, month or hour |
today | The date the letter is made |
values.<key> | An extra field the template asks HR to fill in when making the letter |
Extra fields
Each template lists the extra inputs it needs as JSON: a key, a label, a type (text, textarea, number, date or select with options), whether it is required, and help text. Required fields must be filled before a draft can be created; an optional field left empty simply disappears from the letter. Dates typed as YYYY-MM-DD are written in the Settings date format.
Some of the Canada offer’s extra fields[
{"key": "province", "label": "Province", "type": "text", "required": true, "help": "e.g. Ontario"},
{"key": "vacation_days", "label": "Vacation days", "type": "number", "required": true},
{"key": "respond_by", "label": "Respond by", "type": "date", "required": true}
]Gaps are visible
A field with no value (a person without an end date, an entity without a signatory) is left in the letter as [person.end_date], highlighted, and listed as missing in the preview and the New document dialog. Values are HTML-escaped before Markdown runs, so a name cannot inject markup.

Versions
Your organization has its own copy of every template. Saving new text, once documents have been made from a template, raises its version; documents keep the version they were made from. A template can be active, draft or retired, and marked as needing a signature or not (certificates and most letters are issued, not signed). New templates of your own are created in the console (blank or as a copy) or through the API (POST /api/templates).

The library
The 22 built-ins are listed with their notes for counsel on Letters & templates. When the library grows, new templates are added to your workspace; your edited copies are never overwritten.