Skip to main content
Templates are reusable email designs that separate your content from your code. Instead of building HTML in your application, design your emails in Lettr and send them by referencing a template slug.

Why Use Templates?

Quick Start

1

Create a Template

Go to Emails in your dashboard and click New Email.
2

Design Your Email

Use the visual editor to design your email, or paste custom HTML.
3

Add Variables

Insert dynamic content using {{variable_name}} syntax.
4

Save and Send

Save your template and send emails using its slug.

Try it in the app

Follow an interactive walkthrough of this guide inside Lettr.

Sending with Templates

Reference templates by their slug when sending:

Specifying a Template Version

By default, Lettr uses the active version of the template. To use a specific version:

Project-Scoped Templates

If your template is in a specific project, include the project_id:
If no project_id is specified, Lettr uses your team’s default project. Make sure a default project is configured in your team settings, or the API will return a 404 error.

Template vs Inline Content

Choose the approach that fits your use case:

Content Priority

When both a template and inline content are provided in the same request:
  1. Template content takes precedence—the template version’s HTML replaces any html parameter
  2. The subject in your request is always used—templates do not provide a fallback subject
  3. Inline html or text is only used when no template_slug is provided
If you provide both template_slug and html, the template HTML will be used. The inline HTML is not a fallback—it is ignored entirely.

Template Organization

Lettr provides a hierarchical system to organize templates:
  • Projects: Separate templates by brand, product, or team
  • Folders: Group related templates within projects
  • Versions: Track changes and control which version is active

Key Features

Visual Editor

Design emails with Topol’s drag-and-drop editor

Projects & Folders

Organize templates with projects and folders

Template Versions

Manage versions and schedule publishing

Saved Blocks

Create reusable sections and synced content

Loop Blocks

Display repeating content like product lists and order items

Template Language

Personalize emails with merge tags and dynamic content

Template Slugs

Each template has a unique slug used to reference it in API calls: Slugs are auto-generated from template names but can be customized. They must be unique within a project.

Visual vs Code Editing

Lettr supports two editing modes:

Visual Editor (Topol)

  • Drag-and-drop interface
  • Pre-built content blocks
  • Responsive design tools
  • No HTML knowledge required

Custom HTML

  • Full control over markup
  • Import existing templates
  • Advanced customization
  • Direct code editing
Each template has an editor_type field (topol or custom_html) that reflects which editing mode is active. You can switch between modes or use both—design visually and fine-tune with code.

Template Parameters Reference

When sending with templates, these parameters control template behavior: *Required if not providing html or text content directly.
substitution_data is used to populate merge tags in your template (like {{name}}). metadata is passed through to webhooks for tracking but is not rendered in the email content.

Template API

List and retrieve templates programmatically. The list endpoint supports pagination with per_page (default 25, max 100) and page query parameters:
Response:
Get a specific template by slug:
Response:
You can scope both endpoints to a specific project by adding ?project_id=123. If omitted, your team’s default project is used.

Best Practices

  1. Use meaningful slugs: order-confirmation is better than template-1
  2. Organize early: Set up projects and folders before creating many templates
  3. Version before changes: Create a version before major redesigns
  4. Use synced blocks: Share headers and footers across templates
  5. Test thoroughly: Send test emails before activating new versions

Template Language

Merge tags, conditionals, and loops

Storage Domains

Host template images on your domain

Integrations

Use templates with Stripe, Supabase, WordPress