craftcms / contact-form

Add a simple contact form to your Craft CMS site.
https://plugins.craftcms.com/contact-form
MIT License
293 stars 93 forks source link

Decoupled Front-End Not Working #250

Open mcclaskiem opened 1 year ago

mcclaskiem commented 1 year ago

Description

I have a decoupled front-end built using Gatsby and would like to use this plug-in as a simple way to handle the contact form. As of now I have spent hours trying to debug this and cant seem to get anywhere. When I post the form submission from the front-end I get a 200 response back but no email is sent and nothing shows up in logs for craft side. The 200 response is shown in what I console.log in my fetch response but the "network" tab of the inspector response tab shows a preview of the homepage. I don't think that it is a CSRF issue because that usually will throw a 400 bad request error. Is there something Im missing here?

I am also using Mailgun SMTP and have successfully sent a test email from the CP.

Example POST payload: action=contact-form%2Fsend&message%5BfromName%5D=Max&message%5BcompanyName%5D=max%40thesmithy.io&fromEmail=test%40test.com&message%5BphoneNumber%5D=1231231234&message%5Bbody%5D=test

Steps to reproduce

  1. Submit form over AJAX using fetch
  2. Observe 200 response

Additional info