Migration

Migrate from SendGrid

Of all the providers, SendGrid is the closest to a literal find-and-replace — the send call already uses from, to, subject, and html. What changes is where your mail lives: eusend sends and stores everything on EU infrastructure, operated by an EU company, instead of a US provider.

The code change

Install the SDK with npm install @eusend_dev/sdk. The field names match; the differences are the client being an instance rather than a global singleton, and eusend returning { data, error } instead of throwing on failure.

Before · SendGrid
import sgMail from '@sendgrid/mail'

sgMail.setApiKey(process.env.SENDGRID_API_KEY)

await sgMail.send({
  from: 'Acme <hello@acme.com>',
  to: 'user@example.com',
  subject: 'Welcome',
  html: '<p>Thanks for signing up.</p>',
})
After · eusend
import { Eusend } from '@eusend_dev/sdk'

const eusend = new Eusend(process.env.EUSEND_API_KEY)

await eusend.emails.send({
  from: 'Acme <hello@acme.com>',
  to: 'user@example.com',
  subject: 'Welcome',
  html: '<p>Thanks for signing up.</p>',
})

Field mapping

SendGrideusendNotes
from / to / cc / bcc / subject / html / textSame namesfrom must use a domain you verified in eusend
replyToreplyToString or array
personalizationsbatch.send([...])One message object per recipient, up to 100 per request
trackingSettingstrackOpens / trackClicksTwo booleans instead of a nested settings object; both default to true
templateId + dynamicTemplateDatatemplateIdeusend has server-side templates; see the docs for the variable syntax
categories / customArgsNo direct equivalent yet. Custom headers are the usual workaround.

If you send over SMTP

SendGrid's SMTP setup — a literal username and your API key as the password — carries straight over. Swap the host, change the username from apikey to eusend, and make sure you're on port 465 with implicit TLS: eusend does not support STARTTLS on 587, which is SendGrid's usual default.

nodemailer
// Before: smtp.sendgrid.net, user "apikey", API key as password
// After: same idea, different literal username — and use implicit TLS on 465
const transport = nodemailer.createTransport({
  host: 'smtp.eusend.dev',
  port: 465,
  secure: true,
  auth: { user: 'eusend', pass: process.env.EUSEND_API_KEY },
})

Webhooks

SendGrid's Event Webhook posts arrays of event objects; eusend posts one signed event per delivery attempt. The types map cleanly:

SendGrid eventeusend event
processedemail.sent
deliveredemail.delivered
bounce, droppedemail.bounced
spamreportemail.complained
openemail.opened
clickemail.clicked

Signature verification changes from SendGrid's ECDSA scheme to HMAC-SHA256 — simpler to implement, same guarantee. The webhook docs show the exact scheme, and you can subscribe your endpoint to only the events you handle.

What's honestly different

Before you flip production

Want it done for you?
The migration page has a copy-paste prompt that lets an AI coding agent do the whole swap against our live API reference. Or email support@eusend.dev — we're happy to help you move over.