[Intum Help](https://intum.com/help.md) / [Mail](https://intum.com/help/mail.md)

# [Templates](https://intum.com/help/mail/templates.md)

## What Are Templates?

Templates are ready-made email message patterns that can be reused. Instead of writing the same response from scratch - choose a template and customize the content.

## Creating a Template

1. Go to **Mail** > **Templates**
2. Click **+** (New Template)
3. Fill in:
   - **Subject** - the default email subject
   - **Content** - the message body, can contain variables (see below)
   - **Name** - internal template name visible when selecting. If left empty, the system will use the subject as the name
   - **[Department](../organizacja/dzial)** - optional assignment to a department (field visible only when departments exist in the system)
4. Save

## Variables in Templates

You can use variables in the template content and subject that will be automatically replaced with data. Syntax: `{{ variable_name }}`.

### Template Example

```
Hi {{ contact.first_name }},

Thank you for reaching out. Your request has been registered.

Best regards,
{{ first_name }} {{ last_name }}
{{ email }}
```

If the email is sent by John Smith (john@company.com) to the contact "Anna Miller", the template will generate:

```
Hi Anna,

Thank you for reaching out. Your request has been registered.

Best regards,
John Smith
john@company.com
```

### Sender Variables

Data of the person sending the email. The same variables as in mailbox signatures:

| Variable | What It Inserts |
|----------|----------------|
| `{{ name }}` | Full sender name |
| `{{ first_name }}` | First name |
| `{{ last_name }}` | Last name |
| `{{ email }}` | Email address |
| `{{ phone }}` | Phone number |

### Contact Variables (Recipient)

Data of the contact linked to the email. Requires the `contact.` prefix:

| Variable | What It Inserts |
|----------|----------------|
| `{{ contact.name }}` | Full contact name |
| `{{ contact.first_name }}` | First name |
| `{{ contact.last_name }}` | Last name |
| `{{ contact.email }}` | Email address |
| `{{ contact.phone }}` | Phone number |
| `{{ contact.mobile_phone }}` | Mobile phone |
| `{{ contact.position }}` | Position |
| `{{ contact.city }}` | City |
| `{{ contact.street }}` | Street |
| `{{ contact.street_no }}` | Building number |
| `{{ contact.post_code }}` | Postal code |
| `{{ contact.country }}` | Country |
| `{{ contact.www }}` | Website |

If the email has no linked contact or sender, variables will be replaced with empty text.

## Using a Template

When composing a new email or reply:

1. Click the **Insert template** button
2. Select a template from the list
3. The content and subject will be inserted into the form
4. Customize the content before sending

## Usage Counter

Each template has a counter showing how many times it has been used and the date of last use. The template list is sorted by most frequently used by default.

## Templates and Departments

Templates can be assigned to a [department](../organizacja/dzial). This way, when selecting a template, only those matching the context are shown - the user sees templates from their department and templates without a department assigned.

## Important Information

- A template requires a filled **subject and content**. The name is optional - if you don't provide one, it will be automatically set to the subject value
- Deleting a template does not affect emails that used it - messages retain their content
- Templates support inline image attachments