关于
This skill enables developers to send emails using Mailtrap-hosted templates, separating email design from application code. It covers using template UUIDs in API payloads and personalizing content with Handlebars variables for transactional or bulk sends. Use it when you need to create, send, or debug these templated emails.
快速安装
Claude Code
推荐npx skills add mailtrap/mailtrap-skills -a claude-code/plugin add https://github.com/mailtrap/mailtrap-skillsgit clone https://github.com/mailtrap/mailtrap-skills.git ~/.claude/skills/using-email-templates在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Using Mailtrap email templates
Overview
Templates are edited in the Mailtrap UI, referenced by UUID from your app, and filled with Handlebars data at send time. The same template can be used with transactional and bulk (promotional) streams; pick the stream when you integrate.
Before generating SDK code: read the README of the relevant SDK repository linked below for current method signatures. Do not rely on memory.
Before generating API request bodies: use the official docs and examples below—request shapes belong in the API reference, not in guesses (including when using AI-assisted coding).
Template management via API (create/update/list outside the UI): Templates API.
Related skills: authorizing-api-requests (tokens, env vars, auth headers), sending-emails (bases and streams), testing-with-sandbox (preview sends without live delivery).
When to use
- When sending or testing emails with Mailtrap-hosted templates (UUID in the send payload)
- Creating or editing templates in the UI
- Templates CRUD via Templates API (automations, provisioning)
- API body using
template_uuidandtemplate_variables - Handlebars conditionals, loops, escaped vs unescaped HTML
Quick reference
API operations
In the developer docs, open:
- Transactional – Send email (including template) (
https://send.api.mailtrap.io) - Bulk – Send email (including template) (
https://bulk.api.mailtrap.io)
Request body variant is typically EmailFromTemplate in the interactive reference.
Authorization
Send with Authorization: Bearer $MAILTRAP_API_TOKEN on the matching stream host (send.api.mailtrap.io or bulk.api.mailtrap.io). Token scope, storage, and the alternative Api-Token header are covered in skill authorizing-api-requests.
Example (curl) — template send
curl -X POST https://send.api.mailtrap.io/api/send \
-H "Authorization: Bearer $MAILTRAP_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"from": {"email": "[email protected]", "name": "Your App"},
"to": [{"email": "[email protected]"}],
"template_uuid": "your-uuid",
"template_variables": {"user_name": "Jane"}
}'
Payload shape
Replace literal text/html with template fields, for example:
template_uuid(from the template Integration tab)template_variables(object whose keys match Handlebars variables)
Exact required fields (e.g. from, to) follow the same rules as non-template sends for that stream.
Handlebars (supported patterns)
{{name}}— escaped output;{{{html}}}— raw HTML{{#if}}/{{#unless}},{{#each}},{{#with}}- Nested paths such as
{{order.id}} - Falsy values that suppress blocks include empty string,
0,false, empty collections (see product docs)
Full syntax and examples: Using Handlebars with Email Templates. Testing workflow: Testing templates with Handlebars. Sandbox preview sends: Send test emails (sandbox).
Where templates live
Templates in the app sidebar. UUID and stream-specific integration snippets are under each template's Integration tab.
Generating template HTML
Proactively offer to generate the template HTML when the user is creating a new template — don't wait to be asked. The output must be a real email template — not arbitrary web HTML — and must be mobile-compatible (responsive, renders well across email clients and screen sizes).
SDKs
Common mistakes
| Mistake | Fix |
|---|---|
Mixing text/html with template_uuid | Use template fields per API schema for template sends |
| Skipping sandbox for risky changes | Preview with sandbox sending / Testing API (see testing-with-sandbox and send test emails) |
GitHub 仓库
常见问题
什么是 using-email-templates Skill?
using-email-templates 是一个 Claude Skill,作者为 mailtrap。Skill 将 Claude 按需加载的说明和资源打包,让 Claude 无需额外提示即可执行与 using-email-templates 相关的任务。
如何安装 using-email-templates?
使用本页的安装命令:将 using-email-templates 作为插件添加到 Claude Code,或将其仓库克隆到 skills 目录,然后重启 Claude 以加载该 Skill。
using-email-templates 属于哪个分类?
using-email-templates 属于元分类。
using-email-templates 可以免费使用吗?
可以。using-email-templates 已收录在 AIMCP,可免费安装。
相关推荐技能
Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。
这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。
该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。
SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。
