Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f4c5d9a95b | |||
| bccae5505b | |||
| 66cbad4957 | |||
| 2376eb5281 | |||
| a1a648b518 |
@@ -22,17 +22,24 @@ export default function LandingPage() {
|
||||
const handleReserve = async () => {
|
||||
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 {
|
||||
await fetch('/api/send-booking', {
|
||||
const response = await fetch('/api/send-booking', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ name, email, mobile, guests, to: 'isittrueorjust@gmail.com' }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
console.error("Server error during booking submission");
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Failed to send email", e);
|
||||
}
|
||||
|
||||
window.open(`https://wa.me/919876543210?text=${message}`, '_blank');
|
||||
window.open(`https://wa.me/919592524646?text=${message}`, '_blank');
|
||||
setIsReserving(false);
|
||||
};
|
||||
|
||||
@@ -207,4 +214,4 @@ export default function LandingPage() {
|
||||
</ReactLenis>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user