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) {
|
||||
const rawFormData = {
|
||||
namhello@antalyarestaurant.ca),
|
||||
email: formData.get('email'),
|
||||
name: formData.get('name'),
|
||||
email: formData.get('email'),
|
||||
phone: formData.get('phone'),
|
||||
eventType: formData.get('eventType'),
|
||||
date: formData.get('date'),
|
||||
guests: formData.get('guests'),
|
||||
message: formData.get('message'),
|
||||
eventType: formData.get('eventType'),
|
||||
date: formData.get('date'),
|
||||
guests: formData.get('guests'),
|
||||
message: formData.get('message'),
|
||||
};
|
||||
|
||||
try {
|
||||
// Send email to hello@antalyarestaurant.ca
|
||||
await transporter.sendMail({
|
||||
from: process.env.EMAIL_USER || '"Antalya Website" <noreply@antalyarestaurant.ca>',
|
||||
to: 'hello@antalyarestaurant.ca',
|
||||
subject: `Catering Inquiry: ${rawFormData.eventType} - ${rawFormData.name}`,
|
||||
text: `
|
||||
try {
|
||||
// Send email to hello@antalyarestaurant.ca
|
||||
await transporter.sendMail({
|
||||
from: process.env.EMAIL_USER || '"Antalya Website" <noreply@antalyarestaurant.ca>',
|
||||
to: 'hello@antalyarestaurant.ca',
|
||||
subject: `Catering Inquiry: ${rawFormData.eventType} - ${rawFormData.name}`,
|
||||
text: `
|
||||
Name: ${rawFormData.name}
|
||||
Email: ${rawFormData.email}
|
||||
Phone: ${rawFormData.phone}
|
||||
@ -53,7 +53,7 @@ try {
|
||||
Number of Guests: ${rawFormData.guests}
|
||||
Message: ${rawFormData.message}
|
||||
`,
|
||||
html: `
|
||||
html: `
|
||||
<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>
|
||||
<p><strong>Name:</strong> ${rawFormData.name}</p>
|
||||
@ -68,11 +68,11 @@ try {
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
});
|
||||
});
|
||||
|
||||
return { success: true, message: 'Your catering inquiry has been submitted successfully to hello@antalyarestaurant.ca!' };
|
||||
} catch (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: true, message: 'Your catering inquiry has been submitted successfully to hello@antalyarestaurant.ca!' };
|
||||
} catch (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.' };
|
||||
}
|
||||
}
|
||||
|
||||
@ -468,7 +468,7 @@
|
||||
.mainHeading {
|
||||
font-family: var(--font-playfair);
|
||||
font-size: var(--main-heading-size);
|
||||
color: #5d4037;
|
||||
color: #c49c5c;
|
||||
line-height: 1.3;
|
||||
font-weight: 700;
|
||||
margin-bottom: 1.5rem;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user