Email to Discord
Forward inbound email to a Discord channel automatically. Webhook Relay parses each email and a transform reshapes it into Discord's { content } format.
You get emails you'd rather see in chat — monitoring alerts, contact-form submissions, order confirmations, vendor notifications — and you want them dropped into a Discord channel automatically instead of buried in an inbox nobody's watching. The problem: there's no native "email this to Discord" button, and Discord only accepts a specific JSON shape, not a raw email.
Webhook Relay closes that gap. It gives you an address that receives inbound email and delivers it as a webhook, parsing each message into clean JSON. A small transform then reshapes that JSON into the format Discord expects, and the message appears in your channel — no server, no inbox polling, no glue code.
Build the message visually: the free webhook → Slack/Discord/Teams formatter lets you template the Discord embed and copy the transform.
How it works
Email comes in, gets parsed, gets reshaped, and lands in Discord — a single hop with a transform in the middle:
inbound email ──▶ Webhook Relay (parse) ──▶ transform to Discord ──▶ channel
(any sender) (email → JSON) (serverless function) (message appears)
Webhook Relay does the hard part — accepting SMTP, parsing MIME, handling attachments and SPF/DKIM/DMARC — and hands your function a tidy JSON object. The transform function only has to map a couple of fields. This is the same email side that powers Email to Webhook; here the destination just happens to be Discord.
Setup
1. Create a bucket. In the dashboard, create a bucket — it's the container that ties an input (where email arrives) to outputs (where it's delivered).
2. Add an email input. On the bucket, add an email input. Webhook Relay gives you a unique address of the form <uuid>@in.webhookrelay-mail.com. Anything sent to that address is parsed and POSTed as JSON to the bucket's outputs — see receive emails as webhooks for the full setup.
3. Add a Discord output. In Discord, open Server Settings → Integrations → Webhooks → New Webhook, pick the channel, and Copy Webhook URL. Paste that URL as the bucket's output destination.
4. Attach a transform. Add the transform function below so the parsed email is reshaped into Discord's { content } format before delivery.
5. Test. Send an email to your <uuid>@in.webhookrelay-mail.com address. Within a second or two it shows up in your Discord channel. If it doesn't, open the bucket's request log to see exactly what was received and delivered.
The transform
Each email arrives as JSON with fields like from, from_name, recipient, to, cc, subject, date, message_id, text, html, headers, spf, dkim, dmarc, and attachments. See the full payload reference for every field. In the transform, the body is r.body (a string); reshape it and set the new body:
const email = JSON.parse(r.body);
const discord = { content: `📧 **${email.subject}**\nFrom: ${email.from_name || email.from}\n\n${email.text}` };
r.setBody(JSON.stringify(discord));
r.setHeader("Content-Type", "application/json");
That parses the incoming email, builds Discord's expected { "content": "..." } body from the subject, sender and plain-text body, and sets the right header. You can also r.setResponseStatus(code) if you need to control what's returned.
A Discord incoming webhook accepts either { "content": "..." } or an embeds array — so for a richer card, build an embeds object instead (map email.subject to the title and email.text to the description) and Discord will render it with a title, colored sidebar, and fields.
Going further
Want only certain senders to reach Discord? Add a From allowlist with filtering and policy so unwanted mail never gets delivered. And because this is the same inbound-email pipeline behind Email to Webhook, you can point the parsed JSON anywhere — Discord today, Slack, an internal API, or several destinations at once tomorrow.
Create a free Webhook Relay account, add an email input, and route your first message into Discord in a few minutes — see the Email to Webhook pillar for the full picture. Building a Discord incoming webhook? The format above is everything it needs.
