First of all, I really appreciate all the packages Brandon has created. I really own him a beer. This is the first time I’ve attempted to use his Sage HTML Forms package and I’m having some issues with it. Hope someone has some more experience with it than I do and can help out.
When submitting a form with the following settings, the form processes and saves the form submission in the submissions tab as it should with all the field data. However, the form is not hidden and the inputs still container the data.
If instead I redirect to a /thank-you page, the form is cleared after submitting, the thank you message appears and then it successfully redirects me to my thank you page.
The major problem here is with the emails. They’re being sent with empty bodies.
According the the brief documentation on this package, Brandon mentions:
When HTML Forms processes "Form Actions" – it simply fetches each input name to create the usable variables.
That being said, the default view would provide `[NAME]` and `[EMAILADDRESS]` .
So it appears I’ve done everything correctly. Does anyone have any idea whats up? Kindly-
I’ve just confirmed that if I use HTML Forms as it is intended, then the body is sent out with the email. So I guess eliminates the plugin itself and I am either doing something wrong with Sage HTML Forms or there is a bug.
how are you using the form in a template? are you using the @htmlform directive? I should probably extend the docs but the form its self needs to be called using hf_get_form().
Hi yes, I was using @htmlform
I had originally set up a few forms weeks ago with Sage HTML Forms and have been struggling to get them to send emails.
I created a new form this morning and the new form works but the previous ones do not. They were all setup the same way so I don’t know why the first couple of forms do not work. I have to create new forms with different slugs for them to work. I struggle with blade cache issues on this machine so it could have been part of that.
The only thing left not working with this setup is hiding the form after a successful completion.
I’ve been wrestling with HTML Forms for a couple of hours now myself. Like the issue @joshb initially had, the emails are not populated with any actual data
I can’t recall exactly how I was able to get my email body data working. I think I had to remove all the variables, save the HTML Form, add them back again and save.
@Log1x - Brandon, can I ask what you use for spam on your forms? HTML Forms suggests using WPBruiser but that doesn’t appear to be compatible with Sage HTML Forms.
Right on. Do you know if you get a lot of spam on your forms?
Previously I was using Ninja Forms with recaptcha and would get hundreds of Canadian Pill entries.
Do you mean clearing out “Message” in the the email submissions setup and then adding back the variables again? Do you have anything in “Form code” under Fields or is that blank?
@Log1x Tried using the directive, but same result unfortunately.
Yes, my form code is empty. IIRC, I removed all the variables and the form code, then saved changes and added the variables back based on what I used to build the form within Sage HTML Forms.
Seems like the issue was that I was setting name="email" on the input and then setting [EMAIL] in the message. Switched to name="EMAIL" and now it works.