Migrare da Resend
Questa pagina mappa il payload POST /emails di Resend, la gestione delle soppressioni e i webhook firmati Svix su Bird. Segui la guida principale alla migrazione nell'ordine indicato e usa queste corrispondenze per i passaggi 1, 3 e 4. I payload di invio hanno campi simili, ma il tracking, i metadati e la verifica dei webhook richiedono modifiche.
Passa questo al tuo agente
Incolla questo in Claude Code, Cursor o Codex. L'agente lavora su questa pagina confrontandola con il tuo repository, usando qualsiasi superficie Bird già disponibile: il server MCP se è collegato, o CLI se è installato e l'accesso è stato effettuato.
Esempio di codice
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.Mappare la chiamata di invio
| Funzione | Resend | Bird |
|---|---|---|
| Mittente | from | from |
| Destinatari | to / cc / bcc | to / cc / bcc (array) |
| Oggetto | subject | subject |
| Corpo | html / text | html / text (almeno uno) |
| Reply-to | reply_to | reply_to (array) |
| Header personalizzati | headers | headers (oggetto stringa → stringa) |
| Etichette filtrabili | tags: coppie {name, value} | tags: coppie {name, value} |
| Contesto round-trip | (nessuno; i tag fungono anche da contesto) | metadata: JSON arbitrario |
| Pianificazione | scheduled_at | scheduled_at |
| Tracking aperture/clic | impostazione per dominio nella dashboard | track_opens / track_clicks (default true) |
| Categoria | (nessuno) | category: marketing (default) o transactional |
I limiti e i valori predefiniti dei campi (numero di destinatari, limiti su tag e metadati) si trovano in Invio di email.
Note sulla migrazione:
- I tag mantengono la stessa struttura, e metadata è un miglioramento. I tag di Resend sono le stesse coppie {name, value} che usiamo noi, ma i vincoli sui valori costringevano a inserire dati di correlazione nei valori dei tag. Qui, sposta il contesto di correlazione in metadata (JSON arbitrario, restituito in ogni evento webhook e nelle letture API) e mantieni i tag per il filtraggio. Vedi tag vs metadati.
- Il tracking si sposta nel payload. Resend gestisce il tracking di aperture/clic per dominio nella dashboard. Noi impostiamo track_opens/track_clicks per messaggio (entrambi con default true).
- scheduled_at si mappa direttamente, nome incluso. Vedi invio pianificato. Per react, renderizza i template React Email in HTML nella tua applicazione (la funzione render di @react-email/render funziona senza modifiche) e invia il risultato come html.
- Gli allegati si trasferiscono direttamente. Gli attachments di Resend (content in base64) corrispondono al nostro array attachments. Imposta content_id per le immagini inline.
- L'invio batch si trasferisce direttamente. L'endpoint POST /emails/batch di Resend diventa il nostro endpoint batch, con risultati per singola voce in entrambi i casi.
Esportare le soppressioni
Resend non espone un'esportazione dedicata della lista di soppressione. Recupera gli indirizzi il cui ultimo evento è bounced o complained. Usa la vista Emails nella dashboard o i tuoi eventi webhook salvati, quindi passa la lista attraverso il ciclo di importazione. Se usi Audiences per le email di marketing, trasferisci anche i contatti segnati come disiscritti.
Tradurre gli eventi webhook
| Esito | Resend | Bird |
|---|---|---|
| Accettato/elaborato | email.sent | email.accepted → email.processed |
| Consegnato | email.delivered | email.delivered |
| Errore temporaneo | email.delivery_delayed | email.deferred |
| Bounce permanente | email.bounced | email.bounced / email.out_of_band_bounce |
| Segnalazione spam | email.complained | email.complained |
| Bloccato/soppresso | email.failed | email.rejected |
| Apertura | email.opened | email.opened |
| Clic | email.clicked | email.clicked |
| Disiscrizione | (nessuno) | email.unsubscribed / email.list_unsubscribed |
La verifica dei webhook usa una costruzione HMAC simile ma con header diversi. Resend usa svix-id, svix-timestamp e svix-signature. Bird segue la specifica Standard Webhooks con gli header webhook-*. Aggiorna il tuo verificatore per usare il signing secret di Bird e la procedura descritta in Webhook ed eventi.
Una differenza di comportamento: gli eventi di Resend sono a livello di messaggio. I nostri eventi di consegna sono a livello di destinatario (recipient_id insieme a email_id), quindi un invio a tre destinatari produce tre esiti di consegna, uno per destinatario.
Passaggio in produzione
Segui domini e DNS e il test di prova in sandbox nella guida principale. Entrambi sono indipendenti dal provider.
Prossimi passi
- Domini di invio: registrazione, ciclo di vita della verifica e i record DNS che stai reindirizzando
- Webhook ed eventi: configurazione dell'endpoint e verifica Standard Webhooks
- Sandbox di test: testa la nuova integrazione prima del passaggio in produzione
- Soppressioni: verifica la lista importata e come viene mantenuta da qui in avanti
Risorse correlate
Prosegui con la documentazione, le guide e gli esempi per questo argomento. Le risorse sono in inglese.
Guarda la guidaGetting started with emailEsplora la funzionalitàEmailSegui il percorso di apprendimentoBuild your first integrationGuida all'implementazioneSend your first email
Prova l'esercitazione e ottieni un brief di implementazione