Fix email formatting by removing leading spaces
All checks were successful
release / Publish to Cloudflare Pages (push) Successful in 1m4s
All checks were successful
release / Publish to Cloudflare Pages (push) Successful in 1m4s
This commit is contained in:
@@ -24,19 +24,19 @@ export const onRequest: PagesFunction<Env> = (context) => {
|
||||
if ((fullName || email) && message) {
|
||||
try {
|
||||
const rawEmailMessage = `----
|
||||
From: Michael Pivato Contact Form <contact@michaelpivato.dev>
|
||||
To: Michael Pivato <contact@michaelpivato.dev>
|
||||
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 <contact@michaelpivato.dev>
|
||||
To: Michael Pivato <contact@michaelpivato.dev>
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user