Readme

Forward Render Error Emails to Val Town's Engineering Discord Channel

shapes at 24-02-08 12.23.08.png

Render sends emails when deploys fail but I want those notifications to come in our team Discord channel, and tag our team. Render doesn't have webhooks for this, so I set up a Gmail filter and forward to this email handler val, which in turn forwards the content to our engineering Discord channel.

1
2
3
4
5
6
7
8
9
10
11
12
import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
export default async function(email: Email) {
console.log(JSON.stringify(email));
if (email.from !== "Render <no-reply@render.com>") return "Unauthorized";
discordWebhook({
url: Deno.env.get("engDiscord"),
content: `<@&1081224342110736394> Render Email: ${email.subject}`,
});
}
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.