All guides
Migrate from SendGrid
Step-by-step guide to switch from SendGrid
Migration steps
1. Update your API key
Replace SendGrid API key with SendPigeon.
Before (SendGrid)
SENDGRID_API_KEY=SG.xxx...After (SendPigeon)
SENDPIGEON_API_KEY=sk_live_abc123...2. Update imports
Replace the SendGrid import with SendPigeon.
Before (SendGrid)
import sgMail from "@sendgrid/mail";
sgMail.setApiKey(process.env.SENDGRID_API_KEY);After (SendPigeon)
import { SendPigeon } from "sendpigeon";
const client = new SendPigeon(process.env.SENDPIGEON_API_KEY);3. Update send calls
Same simple object structure. Just swap the method name.
Before (SendGrid)
await sgMail.send({
to: "user@example.com",
from: "hello@yourdomain.com",
subject: "Hello",
html: "<p>Welcome!</p>",
});After (SendPigeon)
await client.send({
to: "user@example.com",
from: "hello@yourdomain.com",
subject: "Hello",
html: "<p>Welcome!</p>",
});4. Update templates (if using)
SendPigeon uses Handlebars syntax. Rename the data field.
Before (SendGrid)
// SendGrid dynamic template
html: "Hello {{name}}"
dynamic_template_data: { name: "John" }After (SendPigeon)
// SendPigeon template
html: "Hello {{name}}"
variables: { name: "John" }Ready to switch?
Get started with 1,000 free emails per month.
Start for free