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"
}}
>