I'm using WordPress as a rest API for my site, meaning the frontend is purely react. But to fetch data and stuff, I'm using WordPress backend. Now I would like to implement contact form 7 with my react app but not too sure how I can achieve this, I have looked at a solution on SO but I'm still stuck.
In my app, I'm doing an axios post request:
const handleSend = ()=> {
axios.post('https://0xsociety.com/wp-json/contact-form-7/v1/contact-forms/258/feedback')
}
Where exactly do I put the options (email, name and message)? This is how my contact form 7 looks like: (default)
<label> Your name
[text* your-name] </label>
<label> Your email
[email* your-email] </label>
<label> Subject
[text* your-subject] </label>
<label> Your message (optional)
[textarea your-message] </label>
[submit "Submit"]
This one: Using Contact Form 7 with React Here are the errors i get:
into: "span.wpcf7-form-control-wrap.your-name"
message: "The field is required."
idref: null
error_id: "-ve-your-name"
into: "span.wpcf7-form-control-wrap.your-email"
message: "The field is required."
idref: null
error_id: "-ve-your-email"