Migrate from SendGrid
Move from SendGrid
to OpenEmail.
Personalizations, dynamic templates, categories and the event webhook, mapped field by field, with a converter that rewrites your code.
The same email,
written both ways.
One message with a reply-to address and a tag, sent through SendGrid and then through OpenEmail.
import sgMail from '@sendgrid/mail'sgMail.setApiKey(process.env.SENDGRID_API_KEY)try {const [response] = await sgMail.send({from: { email: '[email protected]', name: 'Acme' },to: '[email protected]',replyTo: '[email protected]',subject: 'Your invoice is ready',html: '<p>Thanks for your order.</p>',categories: ['invoice'],})console.log(response.statusCode)} catch (error) {console.error(error.response?.body ?? error)}
import { init, openemail } from '@openemail/sdk'init({ apiKey: process.env.OPENEMAIL_API_KEY })try {const email = await openemail.emails.send({from: { email: '[email protected]', name: 'Acme' },to: '[email protected]',replyTo: '[email protected]',subject: 'Your invoice is ready',html: '<p>Thanks for your order.</p>',tags: { category: 'invoice' },})console.log(email.status)} catch (error) {console.error(error.message)}
Field by field,
what goes where.
Each option SendGrid takes, and its place in OpenEmail.
| SendGrid | OpenEmail | Notes |
|---|---|---|
personalizations[].to | to | One message per personalization. |
reply_to | replyTo | One address per message. |
content[] | html, text | One field per content type. |
template_id, dynamic_template_data | template: { id, props } | Recreate the template in OpenEmail first. |
categories, custom_args | tags | Up to 10 key and value pairs. |
send_at | scheduledAt | A date instead of Unix seconds. |
tracking_settings | tracking: { opens, clicks } | Two switches on each message. |
attachments[].type | attachments[].contentType | Base64 or bytes, 5 MB in total. |
batch_id | emails.cancel(id) | Cancel each message by its own id. |
asm.group_id | suppressions.add | Unsubscribes go to one suppression list. |
Converter
Paste your SendGrid code,
get it back on OpenEmail.
Pick where the code comes from and its language. Recognised keys are removed in your browser, and nothing you paste is kept.
Beyond the code,
four more steps.
- 01
Add your sending domain
Add it in OpenEmail and publish the DNS records it lists. Sending starts once the signing record answers.
- 02
Create an API key
Keys start with oe_live_ and carry only the scopes you give them.
- 03
Move your webhooks
Create an endpoint for the events listed below and check the X-OpenEmail-Signature header on every request.
- 04
Bring contacts and suppressions
Import your contacts as a CSV on an audience page, and add the addresses SendGrid suppressed to the suppression list.
Webhook events,
renamed.
Each SendGrid event and the OpenEmail event that replaces it. Every request carries one event, signed.
| SendGrid | OpenEmail |
|---|---|
processed | email.sent |
delivered | email.delivered |
deferred | email.delivery_delayed |
bounce | email.bounced |
dropped | email.suppressed |
spamreport | email.complained |
open | email.opened |
click | email.clicked |
unsubscribe | suppression.added |
Moving from SendGrid,
answered.
Moving from
somewhere else?
Every guide has the same converter, field map and checklist.
Converted?
Create the key it reads.
A workspace takes a minute. Add your domain, create an API key and set OPENEMAIL_API_KEY.