Migracja z Resend
Ta strona mapuje payload POST /emails Resend, obsługę blokad i webhooki podpisywane przez Svix na Bird. Wykonuj kroki z głównego przewodnika migracji po kolei i korzystaj z tych mapowań dla kroków 1, 3 i 4. Payloady wysyłki mają podobne pola, ale śledzenie, metadane i weryfikacja webhooków wymagają zmian.
Przekaż to swojemu agentowi
Wklej to do Claude Code, Cursor lub Codex. Agent przejdzie przez tę stronę na tle Twojego repozytorium, korzystając z dowolnej powierzchni Bird, którą 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 Resend 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/resend.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 Resend usage in this repository before you change anything: the POST /emails and batch call sites and any SDK wrappers around them, the 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. Rebuild my suppression list and import it into Bird before any production traffic goes through Bird, so my first sends do not reach addresses that already bounced or complained. Resend publishes no suppression export, so there is no endpoint that returns this list: derive it from whatever bounce and complaint events I have stored from my webhook, from the dashboard's Emails view, and from contacts marked unsubscribed in any Audience I use. That means the list can be incomplete without either of us noticing, so show me the list you built and tell me which of those sources each address came from before you import anything. 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. Verification is a header change rather than a rewrite here: Resend signs with Svix and Bird signs per Standard Webhooks, which is the same HMAC construction with the svix-* headers renamed to webhook-*, so keep my verifier and rename what it reads. The event shape does change: Resend's events are scoped to a message and Bird's are scoped to a recipient, so a send to three recipients yields three outcomes rather than one. 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 Resend path is a separate step that comes later: ask me again and wait for me to reply with the words retire the Resend 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
| Funkcja | Resend | Bird |
|---|---|---|
| Nadawca | from | from |
| Odbiorcy | to / cc / bcc | to / cc / bcc (tablice) |
| Temat | subject | subject |
| Treść | html / text | html / text (co najmniej jedno) |
| Reply-to | reply_to | reply_to (tablica) |
| Własne nagłówki | headers | headers (obiekt string → string) |
| Etykiety do filtrowania | tags: pary {name, value} | tags: pary {name, value} |
| Kontekst dwukierunkowy | (brak; tagi pełnią podwójną funkcję) | metadata: dowolny JSON |
| Planowanie | scheduled_at | scheduled_at |
| Śledzenie otwarć/kliknięć | ustawienie per domena w dashboardzie | track_opens / track_clicks (domyślnie true) |
| Kategoria | (brak) | category: 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 do portowania:
- Tagi zachowują swoją strukturę, a metadata to ulepszenie. Tagi Resend to te same pary {name, value}, których używamy, ale ograniczenia wartości wymuszały umieszczanie danych korelacyjnych w wartościach tagów. Tutaj przenieś kontekst korelacji do metadata (dowolny JSON, zwracany w każdym zdarzeniu webhookowym i przy odczytach API) i zostaw tagi do filtrowania. Zobacz tagi a metadane.
- Śledzenie przenosi się do payloadu. Resend przełącza śledzenie otwarć/kliknięć per domena w dashboardzie. My ustawiamy track_opens/track_clicks per wiadomość (oba domyślnie true).
- scheduled_at mapuje się bezpośrednio, łącznie z nazwą. Zobacz planowane wysyłanie. W przypadku react wyrenderuj szablony React Email do HTML w swojej aplikacji (funkcja render z @react-email/render działa bez zmian) i wyślij wynik jako html.
- Załączniki portują się bezpośrednio. attachments Resend (base64 content) mapują się na naszą tablicę attachments. Ustaw content_id dla obrazów inline.
- Wysyłka wsadowa portuje się bezpośrednio. POST /emails/batch Resend staje się naszym endpointem wsadowym, z wynikami per wpis w obu przypadkach.
Eksportuj blokady
Resend nie udostępnia dedykowanego eksportu listy blokad. Pobierz adresy, których ostatnie zdarzenie to bounced lub complained. Użyj widoku Emails w dashboardzie lub zapisanych zdarzeń webhookowych, a następnie przepuść listę przez pętlę importu. Jeśli korzystasz z Audiences do mailingu marketingowego, przenieś też kontakty oznaczone jako wypisane.
Przetłumacz zdarzenia webhookowe
| Wynik | Resend | Bird |
|---|---|---|
| Zaakceptowano/przetworzono | email.sent | email.accepted → email.processed |
| Dostarczono | email.delivered | email.delivered |
| Tymczasowa awaria | email.delivery_delayed | email.deferred |
| Trwałe odrzucenie | email.bounced | email.bounced / email.out_of_band_bounce |
| Zgłoszenie spamu | email.complained | email.complained |
| Zablokowano/wstrzymano | email.failed | email.rejected |
| Otwarcie | email.opened | email.opened |
| Kliknięcie | email.clicked | email.clicked |
| Wypisanie | (brak) | email.unsubscribed / email.list_unsubscribed |
Weryfikacja webhooków wykorzystuje pokrewną konstrukcję HMAC, ale inne nagłówki. Resend używa svix-id, svix-timestamp i svix-signature. Bird stosuje specyfikację Standard Webhooks z nagłówkami webhook-*. Zaktualizuj swój weryfikator, aby używał sekretu podpisującego Bird i procedury z sekcji Webhooki i zdarzenia.
Jedna różnica w zachowaniu: zdarzenia Resend dotyczą pojedynczej wiadomości. Nasze zdarzenia dostarczenia dotyczą pojedynczego odbiorcy (recipient_id obok email_id), więc wysyłka do trzech odbiorców generuje trzy wyniki dostarczenia, po jednym na odbiorcę.
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
- Blokady: potwierdź zaimportowaną listę i sposób, w jaki ją utrzymujemy od tego momentu
Powiązane zasoby
Kontynuuj z dokumentacją, przewodnikami i przykładami dotyczącymi tego tematu. Zasoby są w języku angielskim.
Obejrzyj przewodnikGetting started with emailPoznaj możliwościEmailPodążaj ścieżką naukiBuild your first integrationPrzewodnik wdrożeniowySend your first email
Wypróbuj ćwiczenie i uzyskaj brief wdrożeniowy