# Merge Template Reference

## Overview

The [Mail Merge Templates](/system-administration/configuring-the-system/mail-merge-templates.md) system uses basic HTML along with some mail merge tokens and simple CSS to build the templates.

{% hint style="info" %}
For more information on general configuration see the [Mail Merge Templates](/system-administration/configuring-the-system/mail-merge-templates.md) page.
{% endhint %}

### Capabilities

The templating system has the following capabilities

* Fully customisable using HTML templates and CSS styles
* Insert any content from the merged record, including photos
* Insert a background image for your letterhead
* Loop on related content and photos to output lists
* Add conditional logic to control content based on data in the item, as well as the item's presence in counters, lists or custom search CQL.
* A default (and extensible) CSS starter pack to control the most common document layouts and formats

### Example

The following example shows a basic format for a multi-page letter. This forms the basis for the examples on this page.

<div><figure><img src="/files/I0kD3jwTCNIZe3Xlcgxn" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="/files/c5SFUxUF0Pl2jyyP0L35" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="/files/6Cih1eGYFoUloRSzTc4N" alt="" width="563"><figcaption></figcaption></figure></div>

### Register-specific tokens

Each token has its own set of tokens that map to that register's fields. For information specific to registers, such as Fire Prevention Notices, Permits or Cases, refer to the relevant guides.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cw.crisisworks.com/security-and-support/technical-reference/merge-template-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
