implement server-side catering inquiry email submission and add styling for catering services page
This commit is contained in:
parent
617034ff08
commit
d1060fe508
@ -29,22 +29,22 @@ export async function submitReservation(formData: FormData) {
|
|||||||
|
|
||||||
export async function submitCateringInquiry(formData: FormData) {
|
export async function submitCateringInquiry(formData: FormData) {
|
||||||
const rawFormData = {
|
const rawFormData = {
|
||||||
namhello@antalyarestaurant.ca),
|
name: formData.get('name'),
|
||||||
email: formData.get('email'),
|
email: formData.get('email'),
|
||||||
phone: formData.get('phone'),
|
phone: formData.get('phone'),
|
||||||
eventType: formData.get('eventType'),
|
eventType: formData.get('eventType'),
|
||||||
date: formData.get('date'),
|
date: formData.get('date'),
|
||||||
guests: formData.get('guests'),
|
guests: formData.get('guests'),
|
||||||
message: formData.get('message'),
|
message: formData.get('message'),
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Send email to hello@antalyarestaurant.ca
|
// Send email to hello@antalyarestaurant.ca
|
||||||
await transporter.sendMail({
|
await transporter.sendMail({
|
||||||
from: process.env.EMAIL_USER || '"Antalya Website" <noreply@antalyarestaurant.ca>',
|
from: process.env.EMAIL_USER || '"Antalya Website" <noreply@antalyarestaurant.ca>',
|
||||||
to: 'hello@antalyarestaurant.ca',
|
to: 'hello@antalyarestaurant.ca',
|
||||||
subject: `Catering Inquiry: ${rawFormData.eventType} - ${rawFormData.name}`,
|
subject: `Catering Inquiry: ${rawFormData.eventType} - ${rawFormData.name}`,
|
||||||
text: `
|
text: `
|
||||||
Name: ${rawFormData.name}
|
Name: ${rawFormData.name}
|
||||||
Email: ${rawFormData.email}
|
Email: ${rawFormData.email}
|
||||||
Phone: ${rawFormData.phone}
|
Phone: ${rawFormData.phone}
|
||||||
@ -53,7 +53,7 @@ try {
|
|||||||
Number of Guests: ${rawFormData.guests}
|
Number of Guests: ${rawFormData.guests}
|
||||||
Message: ${rawFormData.message}
|
Message: ${rawFormData.message}
|
||||||
`,
|
`,
|
||||||
html: `
|
html: `
|
||||||
<div style="font-family: Arial, sans-serif; line-height: 1.6; color: #441109;">
|
<div style="font-family: Arial, sans-serif; line-height: 1.6; color: #441109;">
|
||||||
<h2 style="color: #c49c5c; border-bottom: 2px solid #c49c5c; padding-bottom: 10px;">New Catering Inquiry</h2>
|
<h2 style="color: #c49c5c; border-bottom: 2px solid #c49c5c; padding-bottom: 10px;">New Catering Inquiry</h2>
|
||||||
<p><strong>Name:</strong> ${rawFormData.name}</p>
|
<p><strong>Name:</strong> ${rawFormData.name}</p>
|
||||||
@ -68,11 +68,11 @@ try {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
});
|
});
|
||||||
|
|
||||||
return { success: true, message: 'Your catering inquiry has been submitted successfully to hello@antalyarestaurant.ca!' };
|
return { success: true, message: 'Your catering inquiry has been submitted successfully to hello@antalyarestaurant.ca!' };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to send catering inquiry email:', error);
|
console.error('Failed to send catering inquiry email:', error);
|
||||||
return { success: false, message: 'There was an error sending your inquiry. Please try again or email us directly.' };
|
return { success: false, message: 'There was an error sending your inquiry. Please try again or email us directly.' };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -468,7 +468,7 @@
|
|||||||
.mainHeading {
|
.mainHeading {
|
||||||
font-family: var(--font-playfair);
|
font-family: var(--font-playfair);
|
||||||
font-size: var(--main-heading-size);
|
font-size: var(--main-heading-size);
|
||||||
color: #5d4037;
|
color: #c49c5c;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user