From 6b285a3ba48615671d461b44cbf60fff4192365d Mon Sep 17 00:00:00 2001 From: akash Date: Wed, 8 Oct 2025 21:27:25 +0530 Subject: [PATCH] tooltip contact integration updated --- components/ContactFloat.js | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/components/ContactFloat.js b/components/ContactFloat.js index 1cb3196..1dd712c 100644 --- a/components/ContactFloat.js +++ b/components/ContactFloat.js @@ -251,7 +251,7 @@ function ChatForm({ onClose }) { if (!formData.phone.trim()) errors.phone = "Phone is required."; if (!formData.service.trim()) errors.service = "Please select a service."; if (!formData.message.trim()) errors.message = "Message is required."; - if (!captchaToken) errors.captcha = "Please verify the CAPTCHA."; + // if (!captchaToken) errors.captcha = "Please verify the CAPTCHA."; setFormErrors(errors); if (Object.keys(errors).length > 0) { @@ -260,19 +260,22 @@ function ChatForm({ onClose }) { } const emailData = { - ...formData, + name: formData.username, + phone: formData.phone, + email: formData.email, + subject: formData.service, message: `Service: ${formData.service}

Message: ${formData.message}`, to: "bloor@rapharehab.ca", - senderName: "Rapha Rehab Chat Form", + senderName: "Rapha Rehab Contact Page", recaptchaToken: captchaToken, }; try { - const res = await axios.post("https://mailserver.metatronnest.com/send", emailData, { - headers: { "Content-Type": "application/json" }, - }); - - // console.log("Server response:", res.data); + const res = await axios.post( + "https://mailserver.metatronnest.com/send", + emailData, + { headers: { "Content-Type": "application/json" } } + ); setAlert({ show: true, @@ -280,18 +283,10 @@ function ChatForm({ onClose }) { message: res?.data?.message || "Message sent successfully!", }); - setFormData({ - username: "", - // lname: "", - email: "", - phone: "", - service: "", - message: "", - }); + setFormData({ username: "", email: "", phone: "", service: "", message: "" }); setCaptchaToken(null); setFormErrors({}); } catch (error) { - // console.error("Error sending message:", error); setAlert({ show: true, type: "danger", @@ -314,10 +309,11 @@ function ChatForm({ onClose }) { zIndex: 2000, maxHeight: "80vh", overflowY: "auto", + padding: "20px" }} >
-
Chat with Us
+
Chat with Us