Sign inGet started

Migracja z Mandrill

Ta strona mapuje payload messages/send Mandrill (Mailchimp Transactional), rejection blacklist i webhooki na Bird. Postępuj zgodnie z głównym przewodnikiem migracji po kolei i użyj tych mapowań do kroków 1, 3 i 4.
Dwie zmiany struktury dominują przy przenoszeniu. Mandrill zagnieżdża wszystko w obiekcie message i uwierzytelnia się za pomocą key w ciele żądania. My przyjmujemy płaski payload najwyższego poziomu i standardowy nagłówek Authorization: Bearer. Ponadto typ odbiorcy type w Mandrill (to/cc/bcc jako pole na każdym adresie) staje się u nas oddzielnymi tablicami to/cc/bcc.

Przekaż to swojemu agentowi

Wklej to do Claude Code, Cursor lub Codex. Agent przetworzy tę stronę na tle Twojego repozytorium, korzystając z dowolnego interfejsu Bird, który już ma: serwera MCP, jeśli jest podłączony, lub CLI, jeśli jest zainstalowany i zalogowany.
Przykład kodu
I am moving an email integration from Mandrill 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/mandrill.md for the payload, 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 Mandrill usage in this repository before you change anything: the messages/send and messages/send-template call sites and any SDK wrappers around them, the webhook handler and the URL it is registered at, and every domain I send from. Mandrill authenticates with an API key passed in the request body rather than a header, so tell me every place that key appears in my code: the port changes how I authenticate, not just what I send, and that key is a secret currently sitting in a payload.
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 my current provider 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 rejects from Mandrill 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. Read the list through rejects/list, and skip the soft-bounce rows: those are transient failures rather than suppressions, and importing them would suppress addresses that are fine. Show me how many rows you skipped. 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. Move the API key out of the request body and into the Authorization header as a bearer token while you are there. Bird signs deliveries per Standard Webhooks rather than Mandrill's scheme, so treat verification as a rewrite rather than a URL change: 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 Mandrill path is a separate step that comes later: ask me again and wait for me to reply with the words retire the Mandrill 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.

Zmapuj wywołanie wysyłki

FunkcjaMandrill (messages/send)Bird
Uwierzytelnianiekey w ciele żądanianagłówek Authorization: Bearer bk_...
Nadawcamessage.from_email / from_namefrom: string lub { "email", "name" }
Odbiorcymessage.to: [{ email, name, type }]to / cc / bcc: podział wg pola type
Tematmessage.subjectsubject
Treśćmessage.html / message.texthtml / text (co najmniej jedno)
Reply-tomessage.headers["Reply-To"]reply_to: tablica
Własne nagłówkimessage.headersheaders: obiekt string → string
Etykiety do filtrowaniamessage.tags: zwykłe stringitags: pary { name, value }
Kontekst dwukierunkowymessage.metadatametadata: dowolny JSON
Zapisany szablonmessages/send-template + merge_varstemplate + template.parameters
Planowaniesend_atscheduled_at
Śledzenie otwarć/kliknięćmessage.track_opens / track_clickstrack_opens / track_clicks (domyślnie true)
Załącznikimessage.attachments: { type, name, content }attachments: { content_type, filename, content }
Obrazy inlinemessage.images: { type, name, content }attachments z content_id
Kategoriakonwencja subaccount / tagscategory: marketing (domyślnie) lub transactional
Limity i wartości domyślne pól (liczba odbiorców, limity tagów i metadanych) znajdziesz w sekcji Wysyłanie e-maili.
Uwagi dotyczące przenoszenia:
  • Spłaszcz i zmień uwierzytelnianie. Usuń wrapper message (jego pola przenieś na najwyższy poziom) i przenieś klucz API z ciała żądania do nagłówka Authorization. Pole key nie ma tutaj odpowiednika.
  • Rozdziel odbiorców wg type. Mandrill oznacza każdego odbiorcę jako to, cc lub bcc na obiekcie adresu. My używamy trzech oddzielnych tablic. Podczas przenoszenia rozdziel listę to według pola type.
  • Tagi stają się parami nazwa/wartość. Tagi w Mandrill to zwykłe stringi ("welcome"). Nasze tagi to pary { name, value }. Wybierz stałą nazwę name, na przykład { "name": "category", "value": "welcome" }, aby filtry i analityka grupowały dane tak jak statystyki w Mandrill. metadata przenosi się bezpośrednio jako JSON.
  • Zapisane szablony przenoszą się z jednym zastrzeżeniem. messages/send-template z Mandrill staje się naszym polem template (odwołanie po ID lub slug) z wartościami w template.parameters. Zobacz wysyłanie z szablonem. Nasze zmienne szablonu działają na poziomie wiadomości, a nie odbiorcy, więc merge_vars per odbiorca stają się jednym wpisem batch na odbiorcę, każdy z własnym parameters.
  • Załączniki przenoszą się bezpośrednio. Base64 content z Mandrill to nasze content, a inline images (odwoływane jako cid: w HTML) stają się wpisami attachments z content_id. Zobacz załączniki.

Eksportuj supresje

Mandrill przechowuje niechciane adresy na swojej rejection blacklist. Pobierz ją za pomocą rejects/list API (lub wyeksportuj z widoku Rejection Blacklist). Każdy wpis ma powód (hard-bounce, soft-bounce, spam, unsub, custom). Pomiń wiersze soft-bounce, ponieważ opisują one przejściowe błędy, a nie prawdziwe supresje. Resztę przepuść przez pętlę importu.

Przetłumacz zdarzenia webhooków

Mandrill wysyła tablice zdarzeń w paczkach; zmapuj wartość event na słownik zdarzeń Bird:
WynikMandrillBird
Wysłane / zaakceptowanesendemail.acceptedemail.processed
Dostarczonodeliveredemail.delivered
Błąd tymczasowydeferralemail.deferred
Trwały bouncehard_bounceemail.bounced / email.out_of_band_bounce
Soft bouncesoft_bounceemail.deferred (potem email.bounced, jeśli zrezygnuje)
Skarga na spamspamemail.complained
Wypisanie sięunsubemail.unsubscribed / email.list_unsubscribed
Odrzucone/zablokowanerejectemail.rejected
Otwarcieopenemail.opened
Kliknięcieclickemail.clicked
Dwie różnice do obsłużenia w kodzie:
  • Akceptacja dzieli się tutaj na dwa zdarzenia. send w Mandrill oznacza, że wiadomość została wstrzyknięta, a delivered oznacza, że serwer odbiorczy ją przyjął. To samo rozróżnienie stosujemy po naszej stronie, ale dodatkowo rozdzielamy akceptację (email.accepted) od przetwarzania (email.processed) przed email.delivered, więc handler oparty wyłącznie na send ma teraz dwa zdarzenia do wyboru.
  • Zdarzenia dotyczą konkretnego odbiorcy i są inaczej podpisywane. Nasze zdarzenia dostarczenia zawierają recipient_id obok email_id, z jednym strumieniem na odbiorcę. Dostarczamy jedno zdarzenie na żądanie i podpisujemy je zgodnie ze specyfikacją Standard Webhooks. Mandrill natomiast podpisuje tablice w paczkach za pomocą X-Mandrill-Signature HMAC. Zobacz Webhooki i zdarzenia, aby poznać weryfikację.

Przełączenie

Przejdź przez domeny i DNS oraz test dymny w sandboxie w głównym przewodniku. Oba kroki są niezależne od dostawcy.

Następne kroki

  • Domeny wysyłkowe: rejestracja, cykl życia weryfikacji i rekordy DNS, które przekierowujesz
  • Webhooki i zdarzenia: konfiguracja endpointu i weryfikacja Standard Webhooks
  • Sandbox testowy: przetestuj nową integrację przed przełączeniem
  • Supresje: potwierdź zaimportowaną listę i sposób, w jaki ją utrzymujemy od tego momentu