Recipe: Discord alerts on email delivery
Get a Discord message whenever Notify delivers mail from one of your domains.
Trigger: Notify Delivery webhook for a verified domain. Action: post to Discord.
Steps
- Create a Discord channel webhook (Channel settings → Integrations → Webhooks) and copy the URL.
- Deploy a tiny HTTPS endpoint that receives Notify events and forwards to Discord (recommended over pasting Discord's URL into Notify).
- In Notify → Webhooks, create a webhook: your endpoint URL, event
Delivery, select the verified domain for that site. - Send a real email from that domain (or a subdomain) and confirm Discord.
export async function POST(req: Request) {
const event = await req.json();
if (String(event.event_type).endsWith('-test')) {
return Response.json({ ok: true });
}
await fetch(process.env.DISCORD_WEBHOOK_URL!, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
content: `📬 Delivered to ${event.destination} from ${event.source} (scoped ${event.domain})`
})
});
return Response.json({ ok: true });
}
Create the Notify subscription:
curl -X POST https://notify.cx/api/webhooks \
-H "Content-Type: application/json" \
-H "x-api-key: $NOTIFY_API_KEY" \
-d '{
"webhookUrl": "https://your-app.com/api/notify-discord",
"subscribedEvents": ["Delivery"],
"domainId": "YOUR_VERIFIED_DOMAIN_UUID"
}'