"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 [email, setEmail] = useState(""); useEffect(() => { const user = "bloor"; const domain = "rapharehab.ca"; setEmail(`${user}@${domain}`); }, []); 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: email, 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 (

Quick Contact

+647-722-3434
+416-622-2873

Email Address

{email ? ( {email} ) : ( Loading... )}

Mailing Address

Address icon

5 – 4335 Bloor Street West
Etobicoke, M9C 2A5

Contact Rapha Rehab – Physiotherapy Clinic in Etobicoke

Looking for trusted physiotherapy in Etobicoke? Rapha Rehab is here to help.

Whether you are experiencing pain, recovering from an accident, preparing for surgery, or seeking rehabilitation support, our experienced team is ready to guide you.

We make it easy to connect with our physiotherapy clinic in Etobicoke and schedule your first appointment.

{alert.show && (
{alert.message}
)}
{formErrors.username && {formErrors.username}}
{formErrors.phone && {formErrors.phone}}
{formErrors.email && {formErrors.email}}
{formErrors.service && {formErrors.service}}
{formErrors.message && {formErrors.message}}
{formErrors.captcha && {formErrors.captcha}}
Physiotherapy at Rapharehab