Skip to content

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.

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.

Everything you write is made of just two things:

Building blockLooks likePurpose
Data marker{{matter.name}}Inserts a value.
Helper{{#if ...}} ... {{#endif}}Adds logic, loops, formatting, and calculations. Helpers always start with #.
  1. Syntax basics (comments, code blocks)
  2. Data markers & variables
  3. Conditionals (#if)
  4. Loops (#foreach)
  5. Maths (#calc, #var, #abs, #round)
  6. Formatting (#datetime, text case, #trim)
  7. Composition (#partial, #question, quote tables)
  8. Property tax helpers (stamp duty)
  9. Error messages & how to fix them
  10. Worked example (putting it all together)

Every helper at a glance. Helper names start with # and are case-insensitive.

HelperWhat it doesGuide
{{marker}}Insert a data valueData markers
#var / $variableStore and reuse a valueData markers, Maths
#if / #elseif / #else / #endifShow or hide contentConditionals
#foreach / #endforeachRepeat once per list itemLoops
#calcCalculate and show a numberMaths
#absAbsolute (positive) valueMaths
#roundRound to decimal placesMaths
#ceil / #floorRound a calculation up / downMaths
#datetimeFormat a dateFormatting
#uppercase / #lowercase / #titlecaseChange text caseFormatting
#trimRemove surrounding spacesFormatting
#partialDrop in a reusable blockComposition
#questionAsk a yes/no question at generation timeComposition
#partial htmlquotetable / #groupedhtmlquotetableBuild fee/quote tables (email only)Composition
#uksdlt and other tax helpersCalculate property taxProperty tax helpers
{{## ... }}Comment (never output)Syntax basics
{{@@ ... }}Code block (many statements at once)Syntax basics
I want to…UseGuide
Insert a name, reference, or dateA data markerData markers
Show text only when a field has a value#ifConditionals
Show different text for different cases#if / #elseif / #elseConditionals
List every item in a matter (e.g. time records)#foreachLoops
Work out a fee or percentage#calc or #varMaths
Round a fee up per part-unit (e.g. per $100 or part thereof)#ceil / #floorMaths
Format a date (e.g. 2 January 2025)#datetimeFormatting
Change text to UPPER, lower, or Title case#uppercase etc.Formatting
Ask the author a yes/no question#questionComposition
Insert a fee/quote table into an emailQuote table helpersComposition
Calculate stamp duty / land tax#uksdlt etc.Property tax helpers
Understand an error messageErrors
TermMeaning
Data markerA placeholder like {{matter.name}} replaced with a real value when the template runs.
HelperA # instruction that adds logic, formatting, or calculation — e.g. #if, #datetime.
Block helperA helper with an opening and closing tag, e.g. #if … #endif.
VariableA value you create in the template with #var; its name starts with $.
PartialA ready-made, reusable block of template inserted with #partial.
StakeholderA person on the matter (client, solicitor, etc.), reached via stakeholder.* markers.

Start here: Syntax basics →