Templating language
The InTouch templating language lets you build dynamic content — emails, SMS messages, documents, and form fee calculations — by mixing fixed text with data markers that are replaced with real values when the template runs.
It uses double curly braces {{ }} to mark the dynamic parts of your template. If you’ve used Handlebars before, the syntax will feel familiar.
A quick example
Section titled “A quick example”Template:
Dear {{matter.primaryclient.forename}},
Thank you for instructing us on {{matter.name}}.Output:
Dear John,
Thank you for instructing us on Sale of 1 High Street, Smith.The two building blocks
Section titled “The two building blocks”Everything you write is made of just two things:
| Building block | Looks like | Purpose |
|---|---|---|
| Data marker | {{matter.name}} | Inserts a value. |
| Helper | {{#if ...}} ... {{#endif}} | Adds logic, loops, formatting, and calculations. Helpers always start with #. |
Guide contents
Section titled “Guide contents”- Syntax basics (comments, code blocks)
- Data markers & variables
- Conditionals (
#if) - Loops (
#foreach) - Maths (
#calc,#var,#abs,#round) - Formatting (
#datetime, text case,#trim) - Composition (
#partial,#question, quote tables) - Property tax helpers (stamp duty)
- Error messages & how to fix them
- Worked example (putting it all together)
Helper cheat sheet
Section titled “Helper cheat sheet”Every helper at a glance. Helper names start with # and are case-insensitive.
| Helper | What it does | Guide |
|---|---|---|
{{marker}} | Insert a data value | Data markers |
#var / $variable | Store and reuse a value | Data markers, Maths |
#if / #elseif / #else / #endif | Show or hide content | Conditionals |
#foreach / #endforeach | Repeat once per list item | Loops |
#calc | Calculate and show a number | Maths |
#abs | Absolute (positive) value | Maths |
#round | Round to decimal places | Maths |
#ceil / #floor | Round a calculation up / down | Maths |
#datetime | Format a date | Formatting |
#uppercase / #lowercase / #titlecase | Change text case | Formatting |
#trim | Remove surrounding spaces | Formatting |
#partial | Drop in a reusable block | Composition |
#question | Ask a yes/no question at generation time | Composition |
#partial htmlquotetable / #groupedhtmlquotetable | Build fee/quote tables (email only) | Composition |
#uksdlt and other tax helpers | Calculate property tax | Property tax helpers |
{{## ... }} | Comment (never output) | Syntax basics |
{{@@ ... }} | Code block (many statements at once) | Syntax basics |
How do I…?
Section titled “How do I…?”| I want to… | Use | Guide |
|---|---|---|
| Insert a name, reference, or date | A data marker | Data markers |
| Show text only when a field has a value | #if | Conditionals |
| Show different text for different cases | #if / #elseif / #else | Conditionals |
| List every item in a matter (e.g. time records) | #foreach | Loops |
| Work out a fee or percentage | #calc or #var | Maths |
| Round a fee up per part-unit (e.g. per $100 or part thereof) | #ceil / #floor | Maths |
Format a date (e.g. 2 January 2025) | #datetime | Formatting |
| Change text to UPPER, lower, or Title case | #uppercase etc. | Formatting |
| Ask the author a yes/no question | #question | Composition |
| Insert a fee/quote table into an email | Quote table helpers | Composition |
| Calculate stamp duty / land tax | #uksdlt etc. | Property tax helpers |
| Understand an error message | — | Errors |
Glossary
Section titled “Glossary”| Term | Meaning |
|---|---|
| Data marker | A placeholder like {{matter.name}} replaced with a real value when the template runs. |
| Helper | A # instruction that adds logic, formatting, or calculation — e.g. #if, #datetime. |
| Block helper | A helper with an opening and closing tag, e.g. #if … #endif. |
| Variable | A value you create in the template with #var; its name starts with $. |
| Partial | A ready-made, reusable block of template inserted with #partial. |
| Stakeholder | A person on the matter (client, solicitor, etc.), reached via stakeholder.* markers. |
Start here: Syntax basics →