---
title: Templates
description: Create reusable email templates for your campaigns, workflows and transactional emails
icon: SwatchBook
---

Templates are stored in the Plunk dashboard and can be used in campaigns, workflows and transactional emails.

## Designing templates

Templates can be created using the built-in editor or by uploading your own HTML.

### Personalization

You can use contact data to personalize your templates by using the handlebars syntax `{{ key }}`, where `key` is the contact data key.

#### Always Available Variables

These variables are always available in your templates, regardless of custom contact data:

| Variable             | Description                            |
| -------------------- | -------------------------------------- |
| `{{id}}`             | The contact's unique identifier        |
| `{{email}}`          | The contact's email address            |
| `{{unsubscribeUrl}}` | URL to the unsubscribe page            |
| `{{subscribeUrl}}`   | URL to the subscribe/resubscribe page  |
| `{{manageUrl}}`      | URL to the preferences management page |

#### Fallback Values

You can provide fallback values for variables that might not be set:

```
Hello {{firstName ?? 'there'}}!
```

If `firstName` is not set, this will render as "Hello there!"

#### Special Fields

The following fields are reserved by Plunk but can still be used.

| Variable         | Description                                         |
| ---------------- | --------------------------------------------------- |
| `{{subscribed}}` | Contact's subscription status (true/false)          |
| `{{locale}}`     | Contact's preferred locale (e.g., 'en', 'fr', 'es') |

### Previewing templates

You can preview your templates by selecting a contact in the preview window. This will allow you to see how the template will look for that specific contact, with their data populated.

## Templates types

There are three types of templates in Plunk. Each type is treated at the same priority when sending emails, you should not pick one type over the other based on deliverability or performance.

| Type          | Respects opt-out | Plunk unsubscribe footer | Description                                                                                                          |
| ------------- | :--------------: | :----------------------: | -------------------------------------------------------------------------------------------------------------------- |
| Marketing     | Yes              | Yes                      | Automatically includes a Plunk-hosted unsubscribe footer. Will not be sent to contacts who are unsubscribed          |
| Transactional | No               | No                       | Does not include any way to unsubscribe. Will be sent to any contact, regardless of subscription state               |
| Headless      | Yes              | No                       | Respects opt-out like marketing, but no Plunk footer is appended. You are responsible for providing an unsubscribe mechanism in the email body. Use `{{unsubscribeUrl}}` or `{{manageUrl}}` to link to Plunk's managed unsubscribe page |
