shellphone.app/app/utils/discord.server.ts

13 lines
409 B
TypeScript
Raw Normal View History

2022-07-08 23:34:18 +00:00
import config from "~/config/config.server";
const { webhookId, webhookToken } = config.discord;
export function executeWebhook(email: string) {
const url = `https://discord.com/api/webhooks/${webhookId}/${webhookToken}`;
return fetch(url, {
body: JSON.stringify({ content: `\`${email}\` just joined Shellphone's waitlist` }),
headers: { "Content-Type": "application/json" },
method: "post",
});
}