Migrating to emitd
Step-by-step guides to migrate from SendGrid, Resend, AWS SES, Postmark, and Mailgun to emitd with zero downtime, identical webhook events, and lower infrastructure costs.
Migrating to emitd gives your engineering team sub-second edge latency on Cloudflare Workers, 1-click Domain Connect DNS setup, dedicated dual message streams (transactional vs. marketing), native AI agent tools (MCP), and transparent pricing without enterprise markups.
This guide provides drop-in code comparisons and a step-by-step zero-downtime cutover plan.
Why switch to emitd?
| Feature | Legacy Providers (SendGrid, Mailgun) | Newer Wrappers (Resend, Postmark) | emitd |
|---|---|---|---|
| Edge API Latency | 200 ms – 500 ms (centralized US servers) | 150 ms – 300 ms | < 45 ms (Cloudflare Workers edge network) |
| DNS Configuration | Manual copy/pasting 5–7 complex records | Manual copy/pasting | 1-Click Domain Connect (GoDaddy, IONOS, 1&1, Squarespace) + Cloudflare Auto-Publish |
| DKIM Method | 3 fragile CNAME delegations | CNAME tokens | BYODKIM (single 2048-bit RSA TXT) or CNAME tokens |
| AI Agent Support | None | None | Native Model Context Protocol (MCP) server for Cursor, Claude Code, Windsurf |
| Dual Message Streams | Expensive sub-account add-ons | Separate products | Built-in (outbound vs broadcast on dedicated IP pools) |
| Pricing at 100k emails | ~$90 – $120 / month | ~$80 / month | $35 / month ($0.35 / 1,000, or $0.28 with prepaid credits) |
Step-by-step zero-downtime migration plan
1. Add and verify your domain in emitd
Before modifying any existing application code, add your sending domain in the emitd Console → Sending domains.
- If your DNS is on GoDaddy, IONOS, 1&1, or Squarespace, click Connect with Domain Connect to automatically authorize the records in 1 click.
- If your DNS is on Cloudflare, use Auto-Publish to merge the DNS records instantly.
- For all other registrars, add the provided DKIM and custom Return-Path records.
Note: Adding emitd's DKIM (relay._domainkey) and Return-Path (mail.yourdomain.com) records will NOT disrupt your current provider's active email sending.
2. Export and import contacts & suppressions
- Bounces & Unsubscribes: Export your suppression list from your previous provider and import it into emitd via the Bulk Suppressions API or console. This ensures you never accidentally re-mail someone who previously unsubscribed.
- Audiences: Import your marketing contacts and metadata via Batch Upsert Contacts.
3. Update your API integration
Coming from Resend, you can switch without changing your code. Otherwise, swap your sending code using the side-by-side examples below.
4. Switch over traffic and webhooks
- Configure your endpoint in emitd Console → Webhooks to receive HMAC-signed delivery, bounce, and complaint events.
- Deploy your application code pointing to
https://api.emitd.com/v1/email. - Once verified, decommission the old provider and clean up legacy DNS records.
Switch from Resend without changing code
emitd serves Resend's send API at a compatibility URL, and the official Resend SDKs read their host from RESEND_BASE_URL. Once your domain is verified in emitd, change two environment variables and keep your code:
RESEND_API_KEY=esk_live_... # an emitd API key
RESEND_BASE_URL=https://api.emitd.com/compat/resendresend.emails.send(), resend.batch.send() and resend.emails.get() then run through emitd, with your emitd keys, quotas, and guardrails. Idempotency keys work as usual.
What's supported: from, to, cc, bcc, reply_to, subject, html, text, tags, headers, attachments with base64 content (10 MB each) and content_id for inline images, template, and scheduled_at as an ISO 8601 date.
What isn't: these are refused with a clear error, so you find out on your first test send rather than from a missing email.
| Field | Instead |
|---|---|
More than one reply_to | Use one address. |
attachments with path | Send the file as base64 content. |
scheduled_at in natural language, like "in 1 hour" | Use an ISO 8601 date. |
headers that set who it's from or where replies go, like Reply-To | Use from and reply_to. |
resend.emails.get() returns the sender, first recipient, subject, date and last_event. We don't keep message bodies in a form we can return, so html and text come back empty, as do cc and bcc.
Managing domains, contacts, and broadcasts all use the emitd API. Resend's webhook format is different too, so update your handlers using the event table below.
If some emails in a batch are refused, the rest still send. The response lists what went in data and what didn't in errors, so check errors and retry only those.
Migration code examples
Migrating from Resend
Both Resend and emitd use clean, developer-first REST APIs. With emitd, you gain sub-second edge dispatch and dual message streams.
import { Emitd } from "@emitd/sdk";
const emitd = new Emitd({ apiKey: process.env.EMITD_API_KEY! });
const { message_id } = await emitd.email.send({
from: "Acme <billing@acme.com>",
to: ["customer@example.com"],
subject: "Invoice #1042",
html_body: "<h1>Thanks for your business</h1>",
message_stream: "outbound", // keeps transactional reputation pristine
});Migrating from SendGrid
SendGrid's verbose personalizations array and complex JSON structure can be replaced with a clean, flat payload:
// emitd: Clean, flat, typed payload
await fetch("https://api.emitd.com/v1/email", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.EMITD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
from: "hello@acme.com",
to: ["alice@example.com"],
subject: "Reset your password",
html_body: "<p>Click here to reset your password...</p>",
tags: { type: "auth" },
}),
});Migrating from AWS SES (Direct)
Managing raw AWS SES requires complex IAM policies, managing SNS topics, Lambda webhook handlers, manual DMARC/DKIM setups, and writing custom suppression filters.
With emitd, you get the raw reliability of AWS SES combined with:
- Zero AWS IAM credentials in your application code.
- Instant DNS automation via Domain Connect and Cloudflare.
- Sub-second edge API on Cloudflare Workers.
- Built-in tracking, webhooks, and suppression management.
// Simple HTTPS call from any edge worker or serverless function
const res = await fetch("https://api.emitd.com/v1/email", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.EMITD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
from: "support@acme.com",
to: ["user@example.com"],
subject: "Security Alert",
text_body: "A new login was detected from your account.",
}),
});Migrating from Postmark
Postmark divides sending into "Transactional" and "Broadcast" servers requiring different Server API tokens.
In emitd, a single API key manages all sends, and you switch streams with one field: message_stream: "outbound" vs message_stream: "broadcast".
{
"from": "notifications@acme.com",
"to": ["user@example.com"],
"subject": "Weekly summary",
"template_alias": "weekly-digest",
"template_model": { "items_count": 5 },
"message_stream": "broadcast"
}Webhook event translation
If your application listens for delivery events, emitd's webhooks provide consistent JSON payloads signed with HMAC SHA-256 (emitd-signature header):
| SendGrid Event | Resend Event | Postmark Event | emitd Event |
|---|---|---|---|
delivered | email.delivered | Delivery | email.delivered |
bounce | email.bounced | Bounce | email.bounced |
spamreport | email.complained | SpamComplaint | email.complained |
open | email.opened | Open | email.opened |
click | email.clicked | Click | email.clicked |
Learn how to verify webhook signatures in the Webhooks guide.
Email deliverability & inbox placement
How emitd protects your sender reputation with SPF, DKIM, DMARC, custom Return-Path, dual streams, automated suppressions, and compliance with Google and Yahoo sender guidelines.
Webhooks
Real-time signed delivery reports, HMAC-SHA256 signature verification in Node.js, Python, Go, and PHP, and automated retry policies.