Switching transactional email providers is mostly not a code change. The send call is usually one helper function. The risk is everything around it: DNS that isn't ready, a sending domain with no history on the new provider, webhooks pointed at the wrong handler, and a suppression list left behind.
Read the transcript
I think the biggest reason people stay with an email provider they don't love is, switching just sounds awful. Like, a whole weekend of broken password resets. And it really doesn't have to be that. Let me show you how you'd move off SendGrid without an email going missing, in about an afternoon. When you think about switching, the code is honestly the easy part. There's really four things that have to come with you. Your suppression list, your templates, your sending domains, and your webhooks.
And the one people forget is the suppressions. That's everybody who's ever bounced, or hit unsubscribe, or complained. And if you leave that behind, you're emailing all of those people again on day one. That's a rough way to start. The way we do it is there's an Import page. You paste in a SendGrid API key, and it pulls all of that over. Your suppressions, your templates with the variables converted, your domains, your webhooks. Or if you're more of a terminal person, it's groundmail migrate sendgrid, and you can do a dry run first, just to see what it would bring.
Nothing changes on the SendGrid side, and we don't keep the key. And then DNS, which is where people get nervous. You keep SendGrid's records exactly where they are. Their DKIM records have different names than ours, so the two just sit next to each other, and mail from both keeps passing. For SPF, you add us to the record you already have. One SPF record, never two. And your DMARC record, you don't touch. Okay, so this is the part I'd really push on.
Don't switch everything at once. Verify your domain, send yourself a test, and then move one type of email. Let's say password resets. Watch it for a day. And if that looks good, move the rest. The code change itself is small. SendGrid has you put the recipients inside a thing called personalizations, and the body inside a content list. Ours is flat. It's from, to, subject, and the HTML. That's kind of it. And then your webhooks. Those come over switched off, on purpose, so nothing fires until you're ready for it.
The events line up, so delivered is delivered, a bounce is a bounce, a spam report is a complaint. And when everything's moved, there's a checklist on the Import page that looks at your last 24 hours of sending. A few days after that, you can take SendGrid's records out. That's how I'd think about it. I mean, it's not zero work, but it's an afternoon, not a weekend. And if you're sending a lot of email and you'd rather not do this alone, there's an option on the Import page, we'll do it for you, and our team runs the switch with you. The full guide's linked down below.
The order below keeps password resets, receipts and sign-in codes flowing the whole time. It works whichever providers you are moving between.
1. Set up DNS on the new provider first
Do this days before you change any code. Add your sending domain to the new provider and publish the records it asks for. Typically that is:
| Record | What it does | Watch out for |
|---|---|---|
| DKIM (TXT or CNAME) | Signs mail with your domain | Uses its own selector, so it sits alongside your old provider's key |
| SPF (TXT) | Lists servers allowed to send for the domain | Only one SPF record per name: merge the new include into the existing one |
| Return path / bounce domain | Receives bounces, aligns SPF | Usually a subdomain such as bounces.example.com |
| DMARC (TXT) | Tells mailbox providers what to do with failures | You likely have one already; leave it in place |
Leave every record your old provider uses where it is. Both providers need to be able to send for your domain while you migrate.
A merged SPF record looks like this:
example.com. TXT "v=spf1 include:old-provider.example include:new-provider.example ~all"
Wait until the new provider shows the domain as verified before moving on. Check the DKIM record resolves from outside your network, not only in your DNS host's dashboard.
2. Bring your suppressions and webhooks over
Before any real mail goes out through the new provider:
- Import suppressions. Export hard bounces and spam complaints from the old provider and import them. Otherwise your first days on the new provider re-send to addresses that already bounced, which is the fastest way to hurt a new sending reputation.
- Point webhooks at a handler that understands both formats. Event names and payloads differ between providers. Map both into the same internal events (delivered, bounced, complained) so the rest of your app doesn't care which provider sent a message.
- Store the new provider's message ids. If you match events to sends by id, make sure the column can hold ids from both.
3. Send through both providers behind a flag
Wrap the send helper so you can choose the provider per message:
async function sendEmail(msg: Message) {
const useNew = await flags.percentage("email-new-provider", msg.to);
return useNew ? newProvider.send(msg) : oldProvider.send(msg);
}
Key the percentage on the recipient so the same person keeps getting mail from the same provider while you ramp. Start with a small share of traffic, or with one low-risk message type such as internal notifications, and raise it in steps.
At each step, compare the two providers on:
- delivery rate and hard bounces
- spam complaints
- time from API call to delivery for your most time-sensitive messages, such as sign-in codes
If the new provider looks worse at any step, hold the percentage where it is and find out why before going further. Common causes are a DNS record that isn't aligned, or a suppression list that wasn't imported.
4. Cut over, and keep a rollback
When the new provider has carried most of your traffic for several days at normal volume and the numbers look normal, set the flag to 100%.
Don't remove the old provider yet. Keep its API key active and its DNS records published for a week or two, so rolling back is a flag change rather than an emergency DNS edit.
5. Clean up
Once you're confident:
- Remove the old code path and the flag.
- Revoke the old provider's API keys and SMTP credentials.
- Delete its DKIM record and return-path record.
- Remove its include from your SPF record.
That last step matters. Every include in an SPF record counts toward the limit of 10 DNS lookups, and stale includes are a common reason SPF starts failing months later.
If you're moving to Groundmail
Groundmail follows the same plan. Verify your domain first, bring your suppressions over, and send through both providers until you're ready. From SendGrid, Postmark, Mailgun, Resend or Amazon SES, the importer copies your suppressions, templates and sending domains in one step; from anywhere else, add suppressions with the API. Our migration guides walk through the field mapping for specific providers, and the quickstart covers the first send.
Frequently asked questions
Can I keep my old provider's DNS records while I set up the new one?
Yes. DKIM records use different selectors, so both providers can sign mail for the same domain at once. SPF is the exception, because a domain can only have one SPF record. Add the new provider's include to your existing record instead of publishing a second one.
How long should I send through both providers?
Long enough to see bounce and complaint rates settle on the new provider at your normal daily volume. For most apps that is a few days to two weeks. Increase the share of traffic in steps rather than all at once.
What do I do with my suppression list?
Export the bounced and complained addresses from your old provider and import them into the new one before you send real traffic. Review unsubscribes separately, because someone who unsubscribed from marketing mail may still need password resets.