using-email-templates

Send Mailtrap email templates by UUID with Handlebars variables.

7|1|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/mailtrap/mailtrap-skills --skill using-email-templates
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-email-templates
Source: https://github.com/mailtrap/mailtrap-skills/tree/main/skills/using-email-templates
Command: npx skills add https://github.com/mailtrap/mailtrap-skills --skill using-email-templates

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Mailtrap-hosted templates separate email design from application code and eliminate guesswork about payload shape, variable handling, and previewing; this reduces integration errors and speeds up sending template-driven transactional or bulk messages.

Core Features & Use Cases

  • Template integration: Reference templates by UUID in API payloads to reuse designs across transactional and bulk streams.
  • Handlebars personalization: Pass template_variables for escaped or raw output, conditionals, loops, and nested paths to render dynamic content per recipient.
  • Testing & preview: Use the Sandbox and Testing API to preview template renders safely before live delivery.
  • Use case: Send a password reset email using a Mailtrap template UUID with template_variables populated from your application.

Quick Start

Send a template-based email by calling the appropriate send endpoint with template_uuid set to the template's UUID and template_variables containing the Handlebars data for the recipient.

Frequently Asked Questions about using-email-templates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send transactional emails using Mailtrap templates?

To send transactional emails with Mailtrap templates, call the send endpoint with the template_uuid and populate template_variables with Handlebars data for recipient-specific personalization. This separates email design from application code and reduces integration errors.

Can I use Handlebars conditionals and loops in Mailtrap email templates?

Yes, Mailtrap templates support Handlebars conditionals, loops, nested paths, and both escaped and unescaped HTML output. Pass your dynamic data via template_variables in the API payload to render complex personalized content per recipient.

What's the best way to preview Mailtrap template renders before live delivery?

The best way to preview Mailtrap template renders safely is using the Sandbox and Testing API. This lets you verify Handlebars variable substitution and template layout before sending transactional or bulk emails to live recipients.

Do I need a template_uuid to send bulk emails through the Mailtrap API?

Yes, you need the template_uuid to reference Mailtrap-hosted templates in API payloads for bulk sending. Include template_variables containing the Handlebars data to populate dynamic content for each recipient across transactional and bulk streams.

Why separate email design from application code using Mailtrap templates?

Separating email design from application code with Mailtrap templates eliminates guesswork about payload shape and variable handling. Reuse designs across transactional and bulk streams by referencing the template UUID, reducing integration errors and speeding up delivery.

Does Mailtrap support unescaped HTML output in Handlebars template variables?

Yes, Mailtrap templates support both escaped and unescaped HTML output through Handlebars template_variables. This allows you to safely render dynamic content or inject raw HTML when needed for transactional and bulk email streams.