From b543b57b4e01573aa1ca97f3af6da0fd536fc16b Mon Sep 17 00:00:00 2001 From: vato007 Date: Mon, 3 Feb 2025 17:38:44 +1030 Subject: [PATCH] Fix email formatting by removing leading spaces --- functions/contact.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/functions/contact.ts b/functions/contact.ts index f533858..c791e6c 100644 --- a/functions/contact.ts +++ b/functions/contact.ts @@ -24,19 +24,19 @@ export const onRequest: PagesFunction = (context) => { if ((fullName || email) && message) { try { const rawEmailMessage = `---- - From: Michael Pivato Contact Form - To: Michael Pivato - Subject: Message from ${fullName ?? email} - - You've received a new message from ${fullName ?? email}. - Full Name: ${formatEmptyString(fullName)} - Organisation: ${formatEmptyString(organisation)} - Email: ${formatEmptyString(email)} - Mobile: ${formatEmptyString(mobile)} - - Message: - ${message} - ----`; +From: Michael Pivato Contact Form +To: Michael Pivato +Subject: Message from ${fullName ?? email} + +You've received a new message from ${fullName ?? email}. +Full Name: ${formatEmptyString(fullName)} +Organisation: ${formatEmptyString(organisation)} +Email: ${formatEmptyString(email)} +Mobile: ${formatEmptyString(mobile)} + +Message: +${message} +----`; await context.env.SERVICE.sendEmail(rawEmailMessage); } catch (e) { return new Response(e);