mailtrap-email-integration
하는 일
이 도구는 회원가입 확인이나 비밀번호 재설정 같은 이메일을 Mailtrap 서비스를 통해 애플리케이션에서 자동으로 보내도록 돕습니다. 테스트 이메일이 실제 사람에게 닿지 않도록 하고, 고객에게 보내는 이메일이 제대로 작동하는지 확인합니다.
사용하는 경우
- ✓회원가입 확인처럼 자동 이메일을 보내야 할 때.
- ✓테스트 이메일이 다른 사람을 방해하지 않고 제대로 도착하는지 확인할 때.
- ✓프로젝트에서 처음으로 이메일 발송을 설정할 때.
스킬 링크
https://github.com/affaan-m/ECC/blob/main/skills/mailtrap-email-integration/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Mailtrap Sandbox를 사용해 테스트 이메일을 보내려면 어떻게 설정하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
도구는 Mailtrap API를 사용해 이메일을 보냅니다. 테스트에는 이메일을 받아 보관하는 '샌드박스'를 사용하고, 실제 이메일에는 발신 도메인을 인증한 뒤 다른 엔드포인트를 사용합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Mailtrap Email Integration
Patterns for adding transactional email sending to an application using Mailtrap's Email API and Sandbox, covering authentication, environment separation, and common delivery pitfalls.
When to Activate
- Implementing a "send email" feature (signup confirmation, password reset, notifications, receipts)
- Debugging why emails aren't arriving in dev/staging
- Setting up a project's first email-sending integration
- Reviewing code that calls an email API directly without sandbox separation
Core Concepts
Sandbox vs. Production separation. Mailtrap provides a Sandbox API that captures emails without delivering them, used for dev/staging so test emails never reach real inboxes. Production sending uses a separate, verified-domain endpoint. Never point a dev environment at the production sending endpoint.
Authentication. Requests use a Bearer token in the Authorization header. Tokens are scoped per project; sandbox and production typically use different tokens.
Domain verification. Production sending requires verifying a sending domain via DNS records (SPF, DKIM, DMARC) before Mailtrap will deliver to real recipients. Skipping this causes silent delivery failures or spam-folder placement.
Code Examples
// Sending via Mailtrap's Email API (production)
async function sendEmail(to: string, subject: string, html: string) {
const response = await fetch("https://send.api.mailtrap.io/api/send", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.MAILTRAP_API_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
from: { email: "no-reply@yourverifieddomain.com", name: "Your App" },
to: [{ email: to }],
subject,
html,
}),
});
if (!response.ok) {
throw new Error(`Email send failed: ${response.status}`);
}
return response.json();
}
// Same call, routed to Sandbox in non-production environments
const MAILTRAP_ENDPOINT = process.env.NODE_ENV === "production"
? "https://send.api.mailtrap.io/api/send"
: `https://sandbox.api.mailtrap.io/api/send/${process.env.MAILTRAP_INBOX_ID}`;
Anti-Patterns
| Anti-Pattern | Why It's a Problem | Instead |
|---|---|---|
| Using the production sending endpoint in dev/test | Real test emails reach real inboxes, risking spam complaints and leaked test data | Route non-production environments to the Sandbox endpoint |
| Hardcoding API tokens in source | Credential leak risk if committed to version control | Load tokens from environment variables / secrets manager |
| Sending before domain verification completes | Emails silently fail or land in spam | Verify SPF/DKIM/DMARC records before enabling production sending |
| No retry/error handling on send failures | Silent notification failures (e.g., user never gets password reset email) | Check response status, log failures, surface actionable errors |
Best Practices
- Keep sandbox and production tokens in separate environment variables, never share one token across environments
- Verify sending domain DNS records before any production launch involving email
- Log delivery failures with enough context to debug (recipient, template, timestamp, response code)
- Treat email sending as a fallible network call: wrap in try/catch, never assume success
Related Skills
api-and-interface-design, security-and-hardening, ci-cd-and-automation
자주 묻는 질문
Mailtrap의 'Sandbox'는 무엇인가요?
여기서 보낸 모든 이메일을 실제 수신자에게 전달하지 않고 받는 테스트 환경입니다. 실제 이메일을 보내지 않고 시험하기에 이상적입니다.
도메인을 왜 인증해야 하나요?
실제 고객에게 이메일을 보내려면 Mailtrap이 이메일이 나가는 도메인을 사용자가 소유하고 있음을 확인해야 합니다. 이는 스팸을 막는 데 도움이 됩니다.
API '토큰'이란 무엇인가요?
애플리케이션이 Mailtrap과 안전하게 통신하기 위해 쓰는 비밀번호 같은 것입니다. 각 환경(테스트와 운영)은 각자의 토큰을 가져야 합니다.
상세 정보
작성자의 원본 설명
Guides agents through integrating transactional email sending via Mailtrap's Email API, including sandbox testing, domain verification, and API authentication. Use when implementing email-sending features, debugging delivery issues, or setting up safe dev/staging email testing.
repo: affaan-m/ECC
인기도
- GitHub 스타
- 280k
- 순위
- #354
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
accessibility
280k에이전트가 모든 사람이 쓸 수 있는 인터페이스를 만들도록 돕습니다. 시각 장애나 운동 장애가 있는 사람도 쓸 수 있게 합니다.
agent-architecture-audit
280k에이전트가 모든 것이 올바르게 작동하는지 점검하도록 돕습니다. AI 시스템의 문제를 찾아 고쳐서 기대대로 작동하게 합니다.
agent-eval
280k에이전트가 서로 다른 AI 코딩 도구를 비교하도록 돕습니다. 특정 작업에서 어느 도구가 더 빠르고, 저렴하고, 믿을 만한지 측정합니다.
agent-harness-construction
280k에이전트가 작업을 더 잘 이해하도록 돕습니다. 에이전트가 쓰는 도구와 지시문을 최적화해 성공 가능성을 높입니다.
비슷한 스킬
shopify
260kShopify GraphQL API로 상품, 재고, 주문, 고객 같은 스토어 데이터를 읽고 업데이트하도록 에이전트를 돕습니다.
rest-graphql-debug
260kREST나 GraphQL API 호출이 실패하는 이유를 찾도록 돕습니다. 연결, 로그인, 요청 형식, 응답을 한 층씩 확인합니다.
har-derived-api-client
260k웹사이트의 네트워크 트래픽을 한 번 기록해 직접 API 클라이언트를 만들도록 돕습니다. 매번 페이지를 클릭하지 않아도 됩니다.