-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
sarmakska edited this page May 3, 2026
·
2 revisions
git clone https://github.com/sarmakska/webhook-to-email.git
cd webhook-to-email
npm install
cp .env.example .envEdit .env:
RESEND_API_KEY=re_...
NOTIFY_EMAIL=you@yourdomain.com
Run:
npm startIn another terminal, fire a test webhook:
curl -X POST http://localhost:3000/hooks/test \
-H "Content-Type: application/json" \
-d '{"hello": "world"}'Check your inbox. Email titled "Webhook · test" should arrive in 2-3 seconds.
For Stripe:
- Stripe Dashboard → Developers → Webhooks → Add endpoint
- URL:
https://your-domain.com/hooks/stripe - Select events you want
- Copy the signing secret, set it as
WEBHOOK_SECRETin.env - Optionally drop
src/templates/stripe.jsfor nice formatting (see Per-Source Templates)
For GitHub:
- Repo → Settings → Webhooks → Add
- URL:
https://your-domain.com/hooks/github - Content type:
application/json - Secret: your
WEBHOOK_SECRET - Event: select what you want
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T.../B.../...
Restart. Now every webhook also goes to Slack.
- Server logs:
webhook-to-email listening on :3000 - On hit:
[stripe] delivered: Invoice paid · 99.00 GBP - Email arrives within 2-3 seconds
- Slack message arrives within 1 second
- 200 returned to the source service
| Problem | Fix |
|---|---|
RESEND_API_KEY and NOTIFY_EMAIL must be set |
Edit .env
|
| 401 on webhook calls | Wrong WEBHOOK_SECRET or missing signature |
| Emails not arriving | Check Resend dashboard for bounces, verify sender domain |
| Slack messages missing | Verify the Slack webhook URL is still active |
500 from /hooks/...
|
Check server logs, usually a malformed template |