Sign inGet started

Migreren vanuit Mailgun

Deze pagina koppelt de POST /v3/{domain}/messages-parameters, suppressielijsten en webhook-events van Mailgun aan Bird. Volg de hoofdmigratiegids op volgorde en gebruik deze koppelingen voor stap 1, 3 en 4.

Geef dit aan je agent

Plak dit in Claude Code, Cursor of Codex. De agent werkt deze pagina door op basis van je eigen repository, met het Bird-oppervlak dat hij al heeft: de MCP-server als er een verbonden is, de CLI als die geïnstalleerd en ingelogd is.
Codevoorbeeld
I am moving an email integration from Mailgun to Bird. Route through it with me.
1. Check what you already have before setting anything up. If Bird's MCP server is connected, use its tools. If the Bird CLI is installed and signed in, use that. Either one is enough, and every step below is an action you take with whichever you have. Only if neither is present, follow https://bird.com/docs/ai/set-up-your-agent.md to set one up and sign me in. Every Bird docs page serves Markdown at its own URL with `.md` appended, so fetch that rather than the HTML.
2. Read https://bird.com/docs/guides/email/migrate/mailgun.md for the parameter, suppression and event mapping, and https://bird.com/docs/guides/email/migrate.md for the order the steps go in.
3. Find and list my Mailgun usage in this repository before you change anything: the /v3/{domain}/messages call sites and any SDK wrappers around them, every o:, v: and h: prefixed parameter I pass, my webhook handler and the URL it is registered at, and every Mailgun domain I send from. Mailgun scopes almost everything per domain, so keep that list of domains: the next two steps both work through it.
4. Register each of those sending domains with Bird and give me the DNS records to publish, following https://bird.com/docs/guides/email/sending-domains.md. Leave every DNS record Mailgun uses exactly as it is: Bird's records are published alongside them and both providers authenticate side by side until I switch traffic. Publishing DNS affects mail for the whole domain, so show me the records and let me publish them.
5. Export my suppressions from Mailgun and import them into Bird before any production traffic goes through Bird, so my first sends do not reach addresses that already bounced or complained. Mailgun keeps three lists per domain, so pull GET /v3/{domain}/bounces, GET /v3/{domain}/complaints and GET /v3/{domain}/unsubscribes for every domain you found. The Bird import takes one address per request and is idempotent, so a partial re-run is safe. https://bird.com/docs/guides/email/suppressions.md has the reason taxonomy.
6. Port the send call and the webhook handler using the mapping tables on the provider page. Two things need attention rather than translation: Mailgun reports one failed event with a severity field where Bird has separate deferred and bounced events, and Bird signs deliveries per Standard Webhooks rather than Mailgun's scheme, so treat verification as a rewrite. See https://bird.com/docs/guides/webhooks.md and https://bird.com/docs/guides/email/events.md.
7. Run my whole integration against Bird's mail sandbox before any production traffic, following https://bird.com/docs/guides/email/testing-sandbox.md. Sandbox sends run the real pipeline without reaching an inbox or touching my sending reputation.
8. Stop and ask me wherever a step needs a decision. Do not point production traffic at Bird until I have seen the sandbox results and replied with the words cut over to Bird. Retiring the Mailgun path is a separate step that comes later: ask me again and wait for me to reply with the words retire the Mailgun path. A reply that agrees without naming what it is authorising is not authorisation. Finish by telling me what is left that only a person can do.

De verzendaanroep koppelen

De formulier-gecodeerde parameterprefixen van Mailgun (o:-opties, v:-variabelen, h:-headers) worden allemaal eersteklas JSON-velden op POST /v1/email/messages:
Wat het doetMailgunBird
Afzenderfromfrom
Ontvangersto / cc / bccto / cc / bcc (arrays)
Onderwerpsubjectsubject
Inhoudhtml / texthtml / text (minstens één)
Reply-toh:Reply-Toreply_to (array)
Aangepaste headersh:X-*headers (string → string object)
Filterbare labelso:tagtags: {name, value}-paren
Retourcontextv:* / X-Mailgun-Variablesmetadata: willekeurig JSON
Opgeslagen templatetemplate + t:variablestemplate + template.parameters
Planningo:deliverytimescheduled_at
Open-/kliktrackingo:tracking-opens / o:tracking-clickstrack_opens / track_clicks (standaard true)
Categorie(geen)category: marketing (standaard) of transactional
Onze veldlimieten en standaardwaarden (aantal ontvangers, tag- en metadatalimieten) staan in E-mail verzenden.
Opmerkingen bij het porten:
  • Het verzoek wordt JSON. Mailgun accepteert multipart form data. Wij verwachten een JSON-body met Content-Type: application/json. Dit is meestal de grootste mechanische wijziging in de port.
  • v:-variabelen werden meegestuurd in events. Onze metadata werkt op dezelfde manier. We sturen je metadata (en tags) mee bij elk webhook-event naast email_id/recipient_id, zodat je handlers ze terugkrijgen zonder een extra lookup.
  • Recipient variables zijn niet één-op-één te porten. Mailgun's recipient-variables personaliseren meerdere ontvangers in één aanroep. Hier hoort die taak bij het batch-endpoint, één item per ontvanger, elk met eigen content of eigen parameters-waarden voor {{ token }}-substitutie.
  • Opgeslagen templates zijn direct te porten. Mailgun's template-parameter wordt ons template-veld met waarden in template.parameters. Zie verzenden met een template.
  • Bijlagen zijn direct te porten. Mailgun-multipart attachment- / inline-bestanden worden onze attachments-array met base64 content (stel content_id in voor inline-afbeeldingen). Zie bijlagen.

Suppressies exporteren

Mailgun houdt drie lijsten per domein bij. Exporteer elke lijst en voer ze door de importloop:
  • GET /v3/{domain}/bounces
  • GET /v3/{domain}/complaints
  • GET /v3/{domain}/unsubscribes
Herhaal dit per verzenddomein. Mailgun's lijsten zijn domeingebonden, terwijl onze suppressies werkruimtegebonden zijn. Je importeert dus de samenvoeging van de lijsten van al je domeinen.

Webhook-events vertalen

Mailgun signaleert tijdelijk vs. permanent falen met één failed-event plus een severity-veld. Wij splitsen ze:
ResultaatMailgunBird
Geaccepteerd/verwerktacceptedemail.acceptedemail.processed
Afgeleverddeliveredemail.delivered
Tijdelijk falenfailed (temporary)email.deferred
Permanente bouncefailed (permanent)email.bounced / email.out_of_band_bounce
Spamklachtcomplainedemail.complained
Geblokkeerd/onderdrukt(geen)email.rejected
Openopenedemail.opened
Klikclickedemail.clicked
Uitschrijvingunsubscribedemail.list_unsubscribed
email.rejected heeft geen Mailgun-tegenhanger: wij rapporteren onderdrukte ontvangers zichtbaar (status rejected, rejection_reason: recipient_suppressed) in plaats van ze stilletjes over te slaan. Voeg er een handler voor toe in plaats van het als een bounce te behandelen.
Verificatie verandert ook: Mailgun ondertekent met een HMAC over timestamp + token in het signature-object van de payload, terwijl wij ondertekenen volgens de Standard Webhooks-specificatie, met headers in plaats van payloadvelden. Vervang je verificatiecode door het recept in Webhooks & events.

Overschakelen

Doorloop domeinen & DNS en de sandbox-rooktest in de hoofdgids. Beide zijn provideronafhankelijk.

Volgende stappen

  • Verzenddomeinen: registratie, verificatielevenscyclus en de DNS-records die je omleidt
  • Webhooks & events: endpoint-setup en Standard Webhooks-verificatie
  • Testsandbox: rooktest van de nieuwe integratie vóór de overschakeling
  • Suppressies: controleer je geïmporteerde lijst en hoe wij die vanaf hier bijhouden