diff --git a/app/appointment-booking-form/ContactClient.js b/app/appointment-booking-form/ContactClient.js
new file mode 100644
index 0000000..63bad89
--- /dev/null
+++ b/app/appointment-booking-form/ContactClient.js
@@ -0,0 +1,254 @@
+"use client";
+
+import { useState, useEffect } from "react";
+import ReCAPTCHA from "react-google-recaptcha";
+import axios from "axios";
+import Link from "next/link";
+import { servicesList } from "@/utils/Services.utils";
+
+export default function ContactClient() {
+ const [formData, setFormData] = useState({
+ username: "",
+ email: "",
+ phone: "",
+ service: "",
+ message: "",
+ });
+
+ const [formErrors, setFormErrors] = useState({});
+ const [captchaToken, setCaptchaToken] = useState(null);
+ const [alert, setAlert] = useState({ show: false, type: "", message: "" });
+
+ const handleChange = (e) => {
+ const { name, value } = e.target;
+ setFormData((prev) => ({ ...prev, [name]: value }));
+ };
+
+ const handleCaptchaChange = (token) => {
+ setCaptchaToken(token);
+ };
+
+ const handleSubmit = async (e) => {
+ e.preventDefault();
+
+ const errors = {};
+ if (!formData.username.trim()) errors.username = "Name is required.";
+ if (!formData.email.trim()) errors.email = "Email is required.";
+ 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.";
+
+ setFormErrors(errors);
+ if (Object.keys(errors).length > 0) return;
+
+ const emailData = {
+ 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 Contact Page",
+ recaptchaToken: captchaToken,
+ };
+
+ try {
+ const res = await axios.post(
+ "https://mailserver.metatronnest.com/send",
+ emailData,
+ { headers: { "Content-Type": "application/json" } }
+ );
+
+ setAlert({
+ show: true,
+ type: "success",
+ message: res?.data?.message || "Message sent successfully!",
+ });
+
+ setFormData({ username: "", email: "", phone: "", service: "", message: "" });
+ setCaptchaToken(null);
+ setFormErrors({});
+ } catch (error) {
+ setAlert({
+ show: true,
+ type: "danger",
+ message: "Failed to send message. Please try again later.",
+ });
+ }
+ };
+
+
+ useEffect(() => {
+ if (alert.show) {
+ const timer = setTimeout(() => {
+ setAlert((prev) => ({ ...prev, show: false }));
+ }, 5000);
+ return () => clearTimeout(timer);
+ }
+ }, [alert.show]);
+
+ return (
+
+ +647-722-3434
+ +416-622-2873
+
+ bloor@rapharehab.ca +
+5 – 4335 Bloor Street West
Etobicoke, M9C 2A5
+ Please complete the contact information below and let us know your needs. + Upon receipt of your information one of our team members will reach out. +
+
+ +
The COVID 19 pandemic has created increased stress and anxiety levels for many people. We would like to take this opportunity to remind you that virtual therapy and at-home or mobile therapy are effective alternatives to in-clinic therapy for many of our clients. diff --git a/app/why-rapha-physiotherapy-etobicoke/WhyusClient.js b/app/why-rapha-physiotherapy-etobicoke/WhyusClient.js index 64ee4a7..0f580a1 100644 --- a/app/why-rapha-physiotherapy-etobicoke/WhyusClient.js +++ b/app/why-rapha-physiotherapy-etobicoke/WhyusClient.js @@ -92,15 +92,15 @@ export default function Team() {





