Why Use Templates?
| Benefit | Description |
|---|---|
| Separation of concerns | Designers update emails without code changes |
| Consistency | Maintain brand standards across all emails |
| Version control | Track changes and rollback when needed |
| Visual editing | Design emails with drag-and-drop tools |
| Reusability | Use the same template for multiple sends |
Quick Start
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 theproject_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:| Feature | Template | Inline HTML |
|---|---|---|
| Reusability | High—use across multiple sends | Low—embedded in each request |
| Maintenance | Update once, affects all sends | Update in each integration point |
| Version control | Built-in versioning | Manual management required |
| Design tools | Visual editor support | Code only |
| Best for | Recurring emails, campaigns | One-off or highly dynamic content |
Content Priority
When both a template and inline content are provided in the same request:- Template content takes precedence—the template version’s HTML replaces any
htmlparameter - The
subjectin your request is always used—templates do not provide a fallback subject - Inline
htmlortextis only used when notemplate_slugis provided
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:| Slug | Use Case |
|---|---|
welcome-email | New user onboarding |
password-reset | Security notifications |
order-confirmation | E-commerce receipts |
weekly-digest | Recurring newsletters |
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
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:| Parameter | Type | Required | Description |
|---|---|---|---|
template_slug | string | No* | Template identifier (slug name) |
template_version | integer | No | Specific version number (uses active version if omitted) |
project_id | integer | No | Project containing the template (uses default project if omitted) |
substitution_data | object | No | Key-value pairs for template variable substitution. All values must be strings. |
metadata | object | No | Key-value data passed to webhooks (not used in templates). All values must be strings. |
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 withper_page (default 25, max 100) and page query parameters:
Best Practices
- Use meaningful slugs:
order-confirmationis better thantemplate-1 - Organize early: Set up projects and folders before creating many templates
- Version before changes: Create a version before major redesigns
- Use synced blocks: Share headers and footers across templates
- Test thoroughly: Send test emails before activating new versions