Add a contact form to the resume #1

Merged
vato007 merged 18 commits from contact-form into main 2025-02-03 18:10:13 +10:30
Showing only changes of commit b543b57b4e - Show all commits

View File

@@ -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}
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)}
You've received a new message from ${fullName ?? email}.
Full Name: ${formatEmptyString(fullName)}
Organisation: ${formatEmptyString(organisation)}
Email: ${formatEmptyString(email)}
Mobile: ${formatEmptyString(mobile)}
Message:
${message}
----`;
Message:
${message}
----`;
await context.env.SERVICE.sendEmail(rawEmailMessage);
} catch (e) {
return new Response(e);