Send Auth0's verification, password reset, welcome, MFA and invitation emails through Delivrie, with a custom email provider Action or over SMTP.
Auth0 sends sign-up verification, password resets, welcome messages, MFA codes and organization invitations. Send them through Delivrie so they come from your own domain and show up in your logs.
exports.onExecuteCustomEmailProvider = async (event, api) => {
const n = event.notification;
const res = await fetch("https://delivrie.io/api/emails", {
method: "POST",
headers: {
Authorization: `Bearer ${event.secrets.DELIVRIE_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": `auth0-${n.message_type}-${n.to}-${event.request?.id || ""}`,
},
body: JSON.stringify({
from: event.secrets.DELIVRIE_FROM || n.from,
to: n.to,
subject: n.subject,
html: n.html,
text: n.text,
tags: [{ name: "source", value: "auth0" }],
}),
});
if (res.ok) return;
const body = await res.json().catch(() => ({}));
const reason = `Delivrie ${res.status}: ${body.message || ""}`;
if (res.status === 429 || res.status >= 500) api.notification.retry(reason);
else api.notification.drop(reason);
};
DELIVRIE_API_KEY (a sending key is enough) and DELIVRIE_FROM, a sender on your verified domain like Acme <auth@mail.acme.com>.Rate limits and server errors are retried by Auth0; an invalid address is dropped and logged. The full version, with tests, is in integrations/auth0.
Choose SMTP Provider instead and enter:
| Field | Value |
|---|---|
| From | An address on your verified domain |
| Host | smtp.delivrie.io |
| Port | 587 |
| Username | delivrie |
| Password | Your Delivrie API key |
See SMTP relay for details.