FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
wilt
wiltemailToDiscordWebhook
Public
Like
emailToDiscordWebhook
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Email to Discord Forwarder

Usage

First, create a Discord Webhook and add it to your Val.town environment variables.

Then create an Email Val:

Create val
import { getEmailHandler } from "https://esm.town/v/wilt/emailToDiscordWebhook?v=19"; // e.g. ["email@example.com", "otherEmail.address.biz"] const senderAllowlist = JSON.parse(Deno.env.get("DISCORD_EMAIL_ALLOWLIST") || "[\"*\"]"); const webhookUrl = Deno.env.get("MY_DISCORD_WEBHOOK")!; export default getEmailHandler({ replyToSender: false, senderAllowlist, webhookUrl, });

Now, whenever you send an email to your email val, it will be forwarded to your Discord webhook

Code
README.mdmain.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.