resend/email-best-practices
Overview
This skill helps teams build reliable, compliant, and high-deliverability email systems. It focuses on architecture, authentication (SPF/DKIM/DMARC), consent capture, and production-ready sending. Use it to reduce spam placement, lower bounce rates, and make informed choices between transactional and marketing emails.
How this skill works
The skill inspects email architecture and lifecycle: capture, validation, consent recording, suppression checks, idempotent sending, retries, and webhook event handling. It guides DNS authentication setup, list hygiene, and legal compliance flows like double opt-in and unsubscribe handling. Practical checks and patterns are provided for deliverability, reliability, and event-driven processing.
When to use it
- Designing which emails your app needs (transactional vs marketing)
- Troubleshooting high spam placement or delivery failures
- Setting up SPF, DKIM, and DMARC for DNS authentication
- Implementing email capture, double opt-in, and consent recording
- Building retry, idempotency, and webhook event processing for production sends
- Ensuring compliance with CAN-SPAM, GDPR, and CASL
Best practices
- Plan email types first: catalog required transactional flows before marketing campaigns
- Authenticate sending domains with SPF, DKIM, and DMARC before first send
- Use double opt-in and store consent metadata for marketing subscribers
- Implement suppression lists and automatic handling of bounces/complaints
- Design idempotent send operations and exponential retry logic for transient failures
- Process webhook events to update delivery status and run list-hygiene jobs regularly
Example use cases
- New app launch: catalog password resets, verification, and receipts; set up DNS auth before sending
- Deliverability troubleshooting: verify SPF/DKIM/DMARC and examine complaint/bounce patterns
- Marketing workflow: capture consent, run compliance checks, then schedule campaigns with unsubscribe links
- Transactional system: build idempotent APIs, retries, and webhook consumers to mark delivered/bounced events
- Scaling sends: implement suppression checks, background list-hygiene, and rate limiting to protect sender reputation
FAQ
Yes. Set up SPF, DKIM, and DMARC first; unauthenticated mail is frequently rejected or sent to spam.
When should I use double opt-in?
Use double opt-in for marketing lists to prove consent and reduce spam complaints; it’s a strong compliance and deliverability practice.
How do I choose transactional vs marketing?
Transactional emails are triggered by user actions and are delivery-critical; marketing emails are promotional and require explicit consent and unsubscribe options.