Skip to content

Worked templating example

This page walks through a single template that uses most of the language at once — data markers, a condition, a calculation, a loop, a question, and a formatted date. Read it top to bottom to see how the pieces fit together.

{{#var $price = property.price}}{{#var $deposit = property.price / 10}}Dear {{stakeholder.client.1.forename}},
Re: {{matter.name}} ({{matter.reference}})
Thank you for your instructions.{{#if property.price}} The agreed price is {{$price}}, so a 10% deposit of {{$deposit}} will be payable on exchange.{{#endif}}
Work carried out so far:
{{#foreach matter.timerecords numerical-sort-by amount desc}}
- {{type}} by {{feeearner}}: {{amount}}
{{#endforeach}}
{{#question $includeSurvey "Offer a survey?"}}{{#if $includeSurvey}}
We can also arrange a full structural survey — just let us know.
{{#endif}}
This letter was prepared on {{#datetime $now 'd mmmm yyyy'}}.
Kind regards,
{{currentuser.fullname}}
PartFeatureGuide
{{stakeholder.client.1.forename}}Data markerData markers
{{#var $deposit = property.price / 10}}Calculation stored in a variableMaths
{{#if property.price}} … {{#endif}}ConditionConditionals
{{#foreach matter.timerecords …}}Loop with sortingLoops
{{#question $includeSurvey …}}Yes/no questionComposition
{{#datetime $now 'd mmmm yyyy'}}Formatted dateFormatting

Assuming the client is John, the price is 250000, two time records exist, and the survey question is answered yes:

Dear John,
Re: Sale of 1 High Street, Smith (MAT-000123)
Thank you for your instructions. The agreed price is 250,000.00, so a 10% deposit of 25,000.00 will be payable on exchange.
Work carried out so far:
- Attendance by A. Solicitor: 350.00
- Letter by T. Trainee: 60.00
We can also arrange a full structural survey — just let us know.
This letter was prepared on 2 January 2025.
Kind regards,
Jane Fee-Earner

← Errors · Contents