This commit is contained in:
parent
37d44b6216
commit
93ef27ef25
1 changed files with 6 additions and 1 deletions
|
|
@ -16,5 +16,10 @@ export async function sendContactMessage(name: string, email: string, message: s
|
|||
|
||||
form.append('content', content);
|
||||
|
||||
return await fetch(env.DISCORD_CONTACT_WEBHOOK, { method: 'POST', body: form });
|
||||
if (!env.DISCORD_CONTACT_WEBHOOK) {
|
||||
throw new Error('Undefined discord webhook');
|
||||
}
|
||||
const url = new URL(env.DISCORD_CONTACT_WEBHOOK);
|
||||
|
||||
return await fetch(url, { method: 'POST', body: form });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue