# Merge Template Reference

## Overview

The [mail-merge-templates](https://docs.cw.crisisworks.com/system-administration/configuring-the-system/mail-merge-templates "mention") 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](https://docs.cw.crisisworks.com/system-administration/configuring-the-system/mail-merge-templates) page.&#x20;
{% 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&#x20;
* 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="https://3923904090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNy7IznbrPLUq6GJDDQDk%2Fuploads%2FTO8i07zdv9Gpzo5QqlPn%2FFPN%20Example%20ACME%20P1.png?alt=media&#x26;token=1fd003e3-b01e-4374-ad68-9a86c2edb854" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://3923904090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNy7IznbrPLUq6GJDDQDk%2Fuploads%2FbEknwCk7uEvY0p0If2qJ%2FFPN%20Example%20ACME%20P2.png?alt=media&#x26;token=97783b24-ccbd-476f-8967-5ac0ff247067" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://3923904090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNy7IznbrPLUq6GJDDQDk%2Fuploads%2FCBPZijGr6HjqO1RbYmx0%2FFPN%20Example%20ACME%20P3.png?alt=media&#x26;token=ef7613ea-676b-4e92-9ace-0896f6254ac8" 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.
