# Temple: Emailit's templating engine, documented

> Variables, defaults, and conditionals for API and automation emails, plus what campaigns and SMTP actually do.

2026-09-17 · George (https://x.com/thegeorge, https://www.linkedin.com/in/jiri-zizka/)

If you have used `{{first_name}}` in an Emailit template, you have already used **Temple**, our small templating engine for subjects, HTML, and text. We never published a full reference. That is now live in the docs: [Temple](https://emailit.com/docs/learn/temple).

Temple is not Liquid or Handlebars. It does a few things well and stops there.

## What you can write

**Variables**, including nested paths:

```
Hello {{first_name}}
Item {{order.items.0.sku}}
```

**Defaults** when a value is missing:

```
Hi {{first_name|"there"}}
```

**Conditionals** (no comparisons, just truthy / falsey):

```
{{#if plan}}
You are on the {{plan}} plan.
{{else}}
You are on the free plan.
{{/if}}
```

No loops, no custom helpers, no partials. Missing variables become empty strings.

## Where it actually runs

This is the part that was undocumented, and easy to get wrong.

- **API** `POST /emails`: Temple runs when you pass a `template` and/or a `variables` object, including inline HTML.
- **Automation** Send Email: Temple always runs. Contact automations expose `{{email}}`, `{{first_name}}`, and `{{custom_fields.*}}` at the root, plus `contact`, `payload`, and `meta`.
- **Templates** in the dashboard: tags are stored as-is. Rendering happens when you send.
- **Campaigns**: not Temple. Only `{{first_name}}`, `{{last_name}}`, `{{email}}`, `{{unsubscribe_url}}`, and `{{cf.field}}`.
- **SMTP**: no server-side templating. The MIME you submit is what we send.

Campaign custom fields use `{{cf.plan}}`. Automation custom fields use `{{custom_fields.plan}}`. Same contact data, different prefixes.

## Get started

Read the full [Temple reference](https://emailit.com/docs/learn/temple), including the availability table and examples, or send a template from the [Email API](https://emailit.com/docs/api-reference/emails/send) with a `variables` object.

---

Source: https://emailit.com/blog/temple-templating-engine/
