diff --git a/frontend/src/components/features/landing/offering-section/offering-section.tsx b/frontend/src/components/features/landing/offering-section/offering-section.tsx index 3eb47d00..69647edc 100644 --- a/frontend/src/components/features/landing/offering-section/offering-section.tsx +++ b/frontend/src/components/features/landing/offering-section/offering-section.tsx @@ -5,14 +5,33 @@ import Image from "next/image"; import { fusionOfferingFeatures } from "./data"; import { CustomLink, ButtonLink } from "~/components/ui"; +import { api } from "~/config"; export const OfferingSection = ({ isResearch = false }) => { const [submitted, setSubmitted] = useState(false); - const handleSubmit = (e: { preventDefault: () => void }) => { + const [contactName, setContactName] = useState(""); + const [contactEmail, setContactEmail] = useState(""); + const [contactMessage, setContacMessage] = useState(""); + + const handleSubmit = async (e: { preventDefault: () => void }) => { e.preventDefault(); // Submit logic here, e.g., send form data to server - setSubmitted(true); + try { + const res = await api.post("/sendContactEmail", { + name: contactName, + email: contactEmail, + message: contactMessage, + }); + + if (res.status === 200) { + setSubmitted(true); + } else { + alert("Failed to send email. You can send one directly to contact@usefusion.app"); + } + } catch (e) { + alert("Failed to send email. You can send one directly to contact@usefusion.app"); + } }; return ( @@ -38,7 +57,7 @@ export const OfferingSection = ({ isResearch = false }) => {

Got any questions about the product or contributing to our research? We're here to help!

-
+
- +
)}