Email Templates
Overview
Email Templates allow you to design, edit, and host HTML email templates, and reference them via API.

By storing the template on Mailtrap and calling it via API, you can easily change the template code without committing to your codebase.
Email Templates support Variables, and Mailtrap uses Handlebars as a template engine.
You can put {{user_name}} into your template and pass "John" as the "user_name" value via API.
For a complete guide on using Handlebars with email templates, see Handlebars Guide.
Creating a template
Navigate to the Templates menu.

Click the Create New Template button.

Click the drop-down menu to select one of your domains, enter the Template name, Subject, and Category, and click Continue.

Choose the Drag & Drop Editor to build the template without coding, or select HTML Editor if you prefer to write/modify the code.

Create/modify the design and click Finish.

The main Templates menu features all your saved templates. To quickly access a saved template, just click on it within the main menu.

Managing templates
List of templates and user permissions
Clicking on Templates in the side menu lists all the templates you can access. Access to templates is managed on a domain level. You need to have Admin access to a domain to manipulate the templates. In case you don't have Edit rights, you can't change the template. Each account can have up to 200 email templates.
You can delete a template. However, this action is irreversible, so be sure to change the sending/testing code after deletion. When the template is deleted, the UUID is also deleted, and Mailtrap won't be able to render it.
Next steps
Editing and Customizing Templates - Learn how to customize templates with the Drag & Drop or Code Editor
Handlebars Guide - Complete guide to using Handlebars syntax in templates
Integration - Integrate templates with Email API/SMTP
Debugging - Test templates with Email Sandbox
Last updated
Was this helpful?

