Migrate from Mailgun to Notify
Move transactional sends from Mailgun to Notify — auth, endpoint, and payload mapping.
Mailgun is a broad email platform. If you only need transactional send + observe, Notify is a smaller surface: one send endpoint, flat pricing, logs and webhooks.
What changes
| Mailgun | Notify | |
|---|---|---|
| Recommended client | mailgun.js (mg.messages.create) | One fetch — no SDK required |
| Auth | HTTP Basic (api + API key) | x-api-key header |
| Endpoint | POST /v3/{domain}/messages on api.mailgun.net or api.eu.mailgun.net | POST https://notify.cx/api/email/send |
| Body | to, subject, html / text (form or JSON) | to, subject, message |
| Observability | Events / webhooks in Mailgun | Logs + webhooks on Pro/Scale |
Before / after
Mailgun (official mailgun.js SDK)
import formData from 'form-data';
import Mailgun from 'mailgun.js';
const mailgun = new Mailgun(formData);
const mg = mailgun.client({
username: 'api',
key: process.env.MAILGUN_API_KEY
});
await mg.messages.create('acme.com', {
from: 'Acme <noreply@acme.com>',
to: ['user@example.com'],
subject: 'Welcome',
html: '<h1>Welcome</h1>'
});
Notify (one fetch — no SDK required)
await fetch('https://notify.cx/api/email/send', {
method: 'POST',
headers: {
'x-api-key': process.env.NOTIFY_API_KEY!,
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: 'Acme <noreply@acme.com>',
to: 'user@example.com',
subject: 'Welcome',
message: '<h1>Welcome</h1>'
})
});
Migration checklist
- Sign up and copy an API key
- Verify your domain
- Map
html/text→message - Recreate webhooks against Notify’s payload (docs)
- Confirm delivery in logs
- Turn down Mailgun sending for those flows