Every dashboard action is an MCP tool your agent can call.Read the docs

Migrate from Mailgun to Send & Retain

Import your suppressions, let your agent rebuild the templates, and swap Mailgun calls one email type at a time.

Start for free

✓Free to start. Unlimited contacts on every tier.

Migration control
Mailgun

Inventory before cutover

01

Inventory

Source material read

02

Rebuild

Created paused

03

Verify

Real inbox test

04

Switch

One trigger first

Destination automation

Paused until validation and explicit cutover

paused
The source stays available

[ 01 / 05 ]Step by step

How do I migrate from Mailgun?

There's no Mailgun connector. Your agent works from your code and your templates, one email type at a time.

  1. Set up your domain

    Your agent creates your sending domain and hands you the DNS records to add, then verifies them and sets up a sender.

  2. Import suppressions first

    Export bounces, unsubscribes, and complaints from each domain's suppressions in Mailgun and import them as your block list before a single send.

  3. Rebuild templates

    Your agent rewrites your Mailgun templates in React Email, keeps their variables, and sends you a test of each.

  4. Swap one call site

    Move one email type to the Send & Retain API. Retry with the same Idempotency-Key and it never sends twice.

    send-welcome.mjs
    const response = await fetch("https://sendandretain.com/api/v1/emails", {
      method: "POST",
      headers: { Authorization: `Bearer ${process.env.AEM_KEY}`,
        "Content-Type": "application/json", "Idempotency-Key": `welcome-${user.id}` },
      body: JSON.stringify({ to: user.email, template: "welcome" }),
    });
  5. Move the rest, then add automations

    Once the first email delivers cleanly, move the others. Then send product events and let your agent build paused automations on top.

[ 02 / 05 ]Example prompts

What can I ask my agent to do?

Paste these into Claude Code, Cursor, or Codex inside your repo.

  • Inventory

    “Find every Mailgun call in this repo and list each email type, its template, and its tags.”

  • Templates

    “Rewrite our Mailgun order shipped template in React Email, render it, and send me a test.”

  • Swap

    “Move the welcome email to the Send & Retain API with an idempotency key. Leave the rest on Mailgun.”

  • Webhooks

    “List what our Mailgun webhook handler does, and set up a signed Send & Retain webhook to match.”

[ 03 / 05 ]Mailgun vs Send & Retain

What changes when I move from Mailgun?

Focus

Mailgun

Email sending infrastructure for developers

Send & Retain

Transactional and marketing email in one system

Marketing automations

Mailgun

Built in your own code

Send & Retain

Automations triggered by product events, always created paused

Contacts

Mailgun

Mailing lists for sending to groups

Send & Retain

One record per person, with attributes, events, and history

Templates

Mailgun

Stored templates or your own HTML

Send & Retain

React Email (TSX), versioned. Edits create drafts

Pricing

Mailgun

Priced on email volume

Send & Retain

Priced on sends. Unlimited contacts on every tier

Who does the work

Mailgun

Developers, in code, plus an official MCP server

Send & Retain

Your app over the API, your AI agent over MCP

[ 04 / 05 ]Do you need to move?

Should I leave Mailgun?

Only if you want more than a sending pipe. Mailgun is a solid choice if you'd rather build everything else yourself.

  • Sending only transactional email and happy building the rest? Stay on Mailgun.
  • Want welcome, trial, and win-back emails without writing the scheduling yourself? Send & Retain does both.
  • Moving? Suppressions first, then one email type at a time.

Questions people ask us

Move one Mailgun call first.

Import your suppressions, rebuild one template, and swap one call site.