diff --git a/src/app/api/contact/route.ts b/src/app/api/contact/route.ts index cb03d3b..998510d 100644 --- a/src/app/api/contact/route.ts +++ b/src/app/api/contact/route.ts @@ -29,6 +29,8 @@ export async function POST(request: Request) { `, }); + console.log(process.env.SENDER_EMAIL); + console.log(process.env.CONTACT_FORM_RECEIVER_EMAIL); return NextResponse.json({ message: 'Email sent successfully.' }, { status: 200 }); } catch (error) { diff --git a/src/app/contactform/ContactForm.module.css b/src/app/contactform/ContactForm.module.css index d787f83..4ce6ddf 100644 --- a/src/app/contactform/ContactForm.module.css +++ b/src/app/contactform/ContactForm.module.css @@ -84,7 +84,7 @@ .input:focus, .textarea:focus { - border-color: #0070f3; + border-color: var(--green); } /* Textarea styles */ diff --git a/src/app/contactform/page.tsx b/src/app/contactform/page.tsx index 17eb88b..4b17564 100644 --- a/src/app/contactform/page.tsx +++ b/src/app/contactform/page.tsx @@ -26,28 +26,28 @@ export default function ContactForm() { }; const handleSubmit = async (e: FormEvent) => { - // e.preventDefault(); - // - // try { - // const res = await fetch('/api/contact', { - // method: 'POST', - // headers: { 'Content-Type': 'application/json' }, - // body: JSON.stringify(formData), - // }); - // - // if (res.ok) { - // toast.success("Thank you for contacting us! Your message has been sent."); - // setFormData({ name: '', email: '', reason: '', message: '' }); - // } else { - // toast.error("There was a problem sending the message. Please try again"); - // } - // } catch (error) { - // toast.error("An unexpected error occurred. Please try again."); - // } + e.preventDefault(); + + try { + const res = await fetch('/api/contact', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(formData), + }); + + if (res.ok) { + toast.success("Thank you for contacting us! Your message has been sent."); + setFormData({ name: '', email: '', reason: '', message: '' }); + } else { + toast.error("There was a problem sending the message. Please try again"); + } + } catch (error) { + toast.error("An unexpected error occurred. Please try again."); + } }; - toast.info("Currently Working on this form!"); + // toast.info("Currently Working on this form!"); return (