Migracja z SendGrid
Ta strona mapuje payload v3 Mail Send, listy suppresji i Event Webhook z SendGrid na Bird. Postępuj zgodnie z głównym przewodnikiem migracji po kolei i korzystaj z tych mapowań w krokach 1, 3 i 4.
Przekaż to swojemu agentowi
Wklej to do Claude Code, Cursora lub Codex. Agent przejdzie przez tę stronę w Twoim repozytorium, korzystając z interfejsu Bird, który już ma: serwera MCP, jeśli jest podłączony, lub CLI, jeśli jest zainstalowane i zalogowane.
I am moving an email integration from SendGrid 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/sendgrid.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 SendGrid usage in this repository before you change anything: the /v3/mail/send call sites and any SDK wrappers around them, the Event Webhook handler and the URL it is registered at, and every domain I send from.
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 suppressions from SendGrid 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. SendGrid splits these across GET /v3/suppression/bounces, GET /v3/suppression/spam_reports, GET /v3/suppression/unsubscribes, and GET /v3/asm/groups/{group_id}/suppressions for each unsubscribe group worth carrying over. 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. Bird signs deliveries per Standard Webhooks rather than SendGrid'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 SendGrid path is a separate step that comes later: ask me again and wait for me to reply with the words retire the SendGrid 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
POST /v3/mail/send w SendGrid umieszcza odbiorców w tablicy personalizations. Nasz POST /v1/email/messages to płaski payload, więc każda personalizacja staje się osobną wysyłką (lub jednym wpisem wsadowym).
| Funkcja | SendGrid | Bird |
|---|---|---|
| Nadawca | from.email | from |
| Odbiorcy | personalizations[].to / cc / bcc | to / cc / bcc (tablice) |
| Temat | subject | subject |
| Treść | content[] (type + value) | html / text (co najmniej jedno) |
| Reply-to | reply_to / reply_to_list | reply_to (tablica) |
| Własne nagłówki | headers | headers (obiekt string → string) |
| Etykiety filtrujące | categories | tags: pary {name, value} |
| Kontekst zwrotny | custom_args | metadata: dowolny JSON |
| Zapisany szablon | template_id + dynamic_template_data | template + template.parameters |
| Planowanie | send_at | scheduled_at |
| Śledzenie otwarć/kliknięć | tracking_settings | track_opens / track_clicks (domyślnie true) |
| Pula IP | ip_pool_name | ip_pool_id (ipp_... lub ipp_shared) |
| Kategoria | (brak) | category: marketing (domyślnie) lub transactional |
Limity pól i wartości domyślne (liczba odbiorców, limity tagów i metadanych) znajdziesz w Wysyłanie e-maili.
Uwagi do migracji:
categoriesto zwykłe stringi. Nasze tagi to pary. Kategoria taka jak"welcome"staje się{"name": "category", "value": "welcome"}. Wybierz stałyname, aby Twoje dashboardy filtrowały tak samo jak statystyki w SendGrid.- Zmapuj
custom_argsnametadata. Bird zwraca Twój ustrukturyzowany kontekst przy odczycie wiadomości i przekazuje go w zdarzeniach, gdy jest dostępny. Zdarzenia wypisu z pojedynczych wysyłek, pochodzące z linków wypisu Bird, zwracają null wmetadataitags, nawet jeśli podano je przy wysyłce. Przechowuj własne mapowanie obszaru roboczego na ID wiadomości, korzystając z przepisu na korelację. - Szablony dynamiczne przenoszą się na zapisane szablony.
template_idplusdynamic_template_datastają siętemplate(referencja po ID lub slugu) plustemplate.parametersw tym samym wywołaniu wysyłki. Zobacz wysyłanie z szablonem.send_atmapuje się bezpośrednio nascheduled_at. - Załączniki przenoszą się bezpośrednio.
attachmentsw SendGrid (base64content,type,filename,content_iddla inline) mapują się na naszą tablicę attachments pole po polu. - Grupy wypisów (
asm) nie przenoszą się jako koncept: obsługujemy list-unsubscribe na poziomie kategorii, więc pocztamarketingautomatycznie otrzymuje obsługę wypisów uwzględniającą suppresje.
Wyeksportuj suppresje
SendGrid rozdziela suppresje między kilka endpointów; wyeksportuj dane z każdego z nich i przepuść je przez pętlę importu:
GET /v3/suppression/bouncesGET /v3/suppression/spam_reportsGET /v3/suppression/unsubscribes(globalne wypisy)GET /v3/asm/groups/{group_id}/suppressionsdla każdej grupy wypisów, którą chcesz przenieść
Przetłumacz zdarzenia webhooka
| Wynik | SendGrid Event Webhook | Bird |
|---|---|---|
| Zaakceptowano/przetworzone | processed | email.accepted → email.processed |
| Dostarczono | delivered | email.delivered |
| Tymczasowa awaria | deferred | email.deferred |
| Trwałe odrzucenie | bounce | email.bounced / email.out_of_band_bounce |
| Zgłoszenie spamu | spamreport | email.complained |
| Zablokowany/objęty suppresją | dropped | email.rejected |
| Otwarcie | open | email.opened |
| Kliknięcie | click | email.clicked |
| Wypis | unsubscribe / group_unsubscribe | email.unsubscribed / email.list_unsubscribed |
Równoważność dropped ↔ email.rejected warto przetestować: tak jak SendGrid, raportujemy odbiorców objętych suppresją jawnie (status rejected, rejection_reason: recipient_suppressed), zamiast po cichu ich pomijać, więc Twoja logika audytu przenosi się bez zmian.
Zmieniają się nie tylko nazwy zdarzeń, ale też weryfikacja: Event Webhook w SendGrid podpisuje kluczem publicznym ECDSA, a my podpisujemy zgodnie ze schematem HMAC Standard Webhooks. Zastąp swój kod weryfikacji gotowym rozwiązaniem z Webhooks i zdarzenia. SendGrid grupuje też zdarzenia w tablice JSON. My dostarczamy jedno zdarzenie na żądanie.
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
- Webhooks i zdarzenia: konfiguracja endpointu i weryfikacja Standard Webhooks
- Sandbox testowy: przetestuj nową integrację przed przełączeniem
- Suppresje: potwierdź zaimportowaną listę i sprawdź, jak utrzymujemy ją od tego momentu
Powiązane zasoby
Przejdź do dokumentacji, przewodników i przykładów dotyczących tego tematu.