---
title: Email Templates
description: Create reusable email templates with variable substitution for campaign communications.
icon: material/email-edit
tags:
  - guide
  - admin
  - broadcast
  - email
---

# Email Templates

Create reusable email templates with variable substitution for campaign communications. Templates are used by advocacy campaigns, shift confirmations, volunteer re-engagement emails, and other automated communications.


![Email Templates](../../../assets/images/screenshots/admin/email-templates.png){ loading=lazy }

---

## Template Categories

Each template belongs to a category that determines where it can be used:

- **INFLUENCE** -- advocacy campaign emails sent to representatives
- **MAP** -- shift confirmation, volunteer thank-you, and canvassing-related emails
- **SYSTEM** -- account verification, password reset, and platform notifications
- **PAYMENT** -- donation receipts, subscription confirmations, and purchase orders

---

## Variable System

Templates use Handlebars-style `{{VARIABLE_NAME}}` placeholders that are replaced at send time. Variables must use uppercase letters and underscores (e.g., `{{RECIPIENT_NAME}}`, `{{CAMPAIGN_TITLE}}`).

- **Text variables** -- simple string substitution for names, dates, URLs, and other text
- **Video variables** -- embed a media library video by referencing its ID
- **Conditional blocks** -- show or hide content with `{{#if VARIABLE}}...{{/if}}` syntax
- **Required vs optional** -- each variable can be marked as required, with sample values for test emails

The template validator automatically extracts all variables from the HTML, text, and subject line content and checks for unmatched conditional blocks.

---

## Version History

Every change to a template's subject line, HTML content, or text content creates a new version. The full version history is preserved, and any previous version can be restored:

- **Version browsing** -- view the subject, HTML, and text content of any past version
- **Rollback** -- restore a previous version (creates a new version entry, preserving the audit trail)
- **Change notes** -- each version includes a description of what changed
- **Author tracking** -- versions record which admin made each change

---

## Test Emails

Before activating a template, send a test email to verify rendering:

- **Variable substitution** -- provide test data for each variable to preview the final output
- **Recipient selection** -- send the test to any email address
- **Test log** -- all test sends are logged with success/failure status and message IDs
- **Rate limited** -- 10 test emails per 15 minutes per user to prevent abuse

---

## Template Caching

Rendered templates are cached in memory for performance. The cache is automatically cleared when a template is created, updated, or deleted. Admins can also manually clear the cache from the admin interface.

---

## Admin Routes

- `/app/email-templates` -- create and manage email templates with a visual editor
