Sending with Templates
The simplest way to send a template email:{{first_name}}). If a required merge tag is missing from the array, the tag renders as an empty string in the sent email. See Merge Tags & Template Language for the full syntax including conditionals and loops.
Template Versioning
Specify a template version to use a specific iteration:templateVersion parameter to use the active (published) version. Lettr always serves the most recently published version unless you explicitly request a different one.
When to use versioning:
- Production safety — Pin to a known-good version so publishing a new draft doesn’t affect live emails
- A/B testing — Send different versions to different cohorts and compare metrics in Analytics
- Gradual rollout — Test a new version with a subset of users before publishing it as the active version
Using the Builder
For more control, use the email builder with templates:Listing Templates
Retrieve available templates via the API:Get Template Details
html property contains the full HTML content of the template, including merge tags. Use this to preview templates or implement custom template editing in your application.
The HTML returned from the API includes Lettr’s merge tag syntax. You’ll need to process substitutions yourself if you want to preview with actual data — or just send a test email using the API’s built-in substitution engine.
Get Merge Tags
Retrieve merge tags (template variables) from a template:key— The merge tag name (used in{{key}}syntax)required— Whether the tag must be provided when sendingtype— Data type (string, object, array)children— Nested tags for objects and arrays
- Validate that you’re providing all required data before sending
- Build dynamic forms for template data input
- Generate type-safe DTOs in statically-typed languages
Create a Template
- Migrating templates from another email service
- Generating templates from a design system or component library
- Building template management features in your application
Delete a Template
What’s Next
Topol Email Editor
Design templates with the visual email editor
Template Language
Learn merge tag syntax, conditionals, and loops
API Reference
Complete template API reference