'use client'; import React, { useRef, useState } from "react" import ReCAPTCHA from "react-google-recaptcha"; import { toast } from "react-hot-toast"; const { RECAPTCHA_SITE_KEY } = process.env; console.log( RECAPTCHA_SITE_KEY) export default function ContactUsContent() { const recaptchaRef = useRef(null); const [person, setPerson] = useState(""); const [email, setEmail] = useState(""); const [phone, setPhone] = useState(""); const [best_time, setBest_time] = useState(""); const [subject, setSubject] = useState(""); const [message, setMessage] = useState(""); const handleOnSubmit = (e) => { e.preventDefault(); recaptchaRef.current.execute(); } const onReCAPTCHAChange = async (captchaCode) => { if(!captchaCode) { return; } const notification = toast.loading('Sending....'); try { const response = await fetch('/api/sendgrid', { method: 'POST', mode: 'cors', cache: 'no-cache', credentials: 'same-origin', headers: { 'Content-Type': 'application/json', }, redirect: 'follow', referrerPolicy: 'no-referrer', body: JSON.stringify({ person, email, phone, best_time, subject, message, captcha: captchaCode }), }) const res = await response.json(); if (response.ok) { toast.success(res.message, { id: notification, }); document.getElementById("contact_form").reset() } else { toast.error(res.message, { id: notification, }); } } catch (error) { toast.error('Sorry an error occurred'); } finally { recaptchaRef.current.reset(); } } return (

Ready to let our team work for you? Feel free to use any of the methods below to get in touch!

Phone: 215.515.8004

Email: contact@simplysyncedllc.com

Contact Form:

setPerson(e.target.value)} id="person" name="person" className="form-input py-2 w-full" type="text" required />
setEmail(e.target.value)} id="email" name="email" className="form-input py-2 w-full" type="email" required />
setPhone(e.target.value)} id="phone" name="phone" className="form-input py-2 w-full" type="text" />
setSubject(e.target.value)} id="subject" name="subject" className="form-input py-2 w-full" type="text" required />
) }