Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2376eb5281 | |||
| a1a648b518 |
@@ -22,12 +22,19 @@ export default function LandingPage() {
|
|||||||
const handleReserve = async () => {
|
const handleReserve = async () => {
|
||||||
const message = encodeURIComponent(`Hello, I would like to book a table at Shaffa. \nName: ${name}\nEmail: ${email}\nMobile: ${mobile}\nGuests: ${guests}`);
|
const message = encodeURIComponent(`Hello, I would like to book a table at Shaffa. \nName: ${name}\nEmail: ${email}\nMobile: ${mobile}\nGuests: ${guests}`);
|
||||||
|
|
||||||
// Send email via simple API request
|
// Send email via API request
|
||||||
try {
|
try {
|
||||||
await fetch('/api/send-booking', {
|
const response = await fetch('/api/send-booking', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
body: JSON.stringify({ name, email, mobile, guests, to: 'isittrueorjust@gmail.com' }),
|
body: JSON.stringify({ name, email, mobile, guests, to: 'isittrueorjust@gmail.com' }),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
console.error("Server error during booking submission");
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Failed to send email", e);
|
console.error("Failed to send email", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user