>-
Automatically convert email templates from other email service providers into Mailtrap-compatible Handlebars syntax. Handles both deterministic pattern conversions (via a Python script) and complex edge cases (via LLM intelligence).
This large 978-word instruction set is purpose-built for testing & qa work in AI coding agents. Paste directly into your CLAUDE.md or AI agent settings.
Automatically convert email templates from other email service providers into Mailtrap-compatible Handlebars syntax. Handles both deterministic pattern conversions (via a Python script) and complex edge cases (via LLM intelligence).
Related skills: using-email-templates (Handlebars syntax, API template send), sending-emails (stream bases and auth), authorizing-api-requests (tokens, env vars, account_id resolution — needed when creating templates or sending via the Templates API after conversion).
sendgrid, mailgun, mandrill-handlebars, mandrill-mergetags, postmark, brevo, or ses.html template files, or raw HTML pasted inline/converted/ subdirectory next to the input.html file first.Fast mode (default): For providers with deterministic conversion patterns. The Python script handles these reliably.
Deep mode: Triggered when:
brevo AND the template contains nested loops, multiple filters, or complex conditional nestingExecute the Python converter script:
python3 {skill_dir}/scripts/converter.py \
--provider {provider} \
--input {input_path} \
--output {output_dir}Where {skill_dir} is the directory containing this SKILL.md file.
Read the output:
.report.txt file(s) generated alongside each converted template. For bulk conversions, also read _summary.txt.Note: When flags are present, the script automatically:
<!-- WARNING: ... --> comment at the top of the converted file<!-- FLAGGED [RULE]: message --> HTML comments so the file can be pasted into the Mailtrap editor without triggering parser errorsFor each flag in the report:
references/conversion-rules.md for the specific rule and recommended action.formatDate, comparison helpers): Cannot be resolved in the template. Report to the user with a clear explanation of what they need to change in their application code. Suggest the replacement variable name.
- Template-level fix possible (e.g., Brevo nested loops, Mandrill mc:edit regions): Apply the conversion using LLM judgment. Show the user the before/after and ask for confirmation before writing.
- Ambiguous (e.g., Postmark closing tag mismatch): Show the user both the original context and the converted output. Ask them to verify.Present flags grouped by category:
## Conversion Complete### Auto-converted: [count] changes
[Brief summary or collapsed details]
### Needs your application code: [count] flags
[For each: what to change, why, suggested variable name]
### Needs verification: [count] flags
[For each: show before/after, ask for confirmation]
Single file:
Converted: {filename}
Changes: [count] | Flags: [count]
Output: {output_path}[Show the conversion report summary]
[If flags exist, show the categorized flag breakdown from Step 3]
Bulk conversion:
Converted: [count] files
Total changes: [count] | Total flags: [count]
Clean: [count] files | Needs review: [count] files
Output: {output_dir}[Show the summary report]
[List files needing review with their specific flags]
After template conversion, always remind the user about the API-side changes they need to make. Reference the quick mapping table:
| Provider | Old template field | Old variables field | Mailtrap field | Mailtrap variables |
|----------|-------------------|--------------------|-----------------------|------------------------|
| SendGrid | template_id | personalizations[].dynamic_template_data | template_uuid | template_variables |
| Mailgun | template | t:variables | template_uuid | template_variables |
| Mandrill | template_name | global_merge_vars + merge_vars | template_uuid | template_variables |
| Postmark | TemplateId/TemplateAlias | TemplateModel | template_uuid | template_variables |
| Brevo | templateId | params | template_uuid | template_variables |
| Amazon SES | TemplateName/TemplateArn | TemplateData | template_uuid | template_variables |
Only show the row for the provider that was just converted.
If the user pastes template HTML directly in chat instead of providing a file path:
references/conversion-rules.md directly using LLM intelligence.<!-- FLAGGED [RULE]: message --> HTML comments (same format as the script). This prevents editor errors when the user pastes the output into Mailtrap.<!-- WARNING: ... --> comment at the top of the converted output noting how many flagged patterns need resolution.Converting Email Templates is a free testing & qa skill for AI coding agents. >-. It provides a specialized system prompt that configures your agent with testing & qa expertise.
Copy the system prompt below and paste it into your CLAUDE.md file or Claude Code's custom instructions to activate Converting Email Templates.
Converting Email Templates is compatible with Claude Code, Cursor, GitHub Copilot, Windsurf, OpenClaw, Cline, and any AI agent that supports custom system prompts or .cursorrules files.
Yes, Converting Email Templates is completely free and open source. The full source is available on GitHub at https://github.com/mailtrap/mailtrap-skills/blob/main/skills/converting-email-templates/SKILL.md. You only need a subscription to the AI agent you use it with.
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.