diff --git a/functions/contact.ts b/functions/contact.ts index 6d8114b..a870e83 100644 --- a/functions/contact.ts +++ b/functions/contact.ts @@ -29,13 +29,15 @@ export const onRequest: PagesFunction = (context) => { // Must have some kind of identifiable information for me to actually care about them. if ((fullName || email) && message) { try { - await context.env.SERVICE.sendEmail({ - fullName, - organisation, - email, - mobile, - message, - }); + context.waitUntil( + context.env.SERVICE.sendEmail({ + fullName, + organisation, + email, + mobile, + message, + }) + ); } catch (e) { return new Response(e); }