Do you have any error-messages? No, nothing in error log, when I add the hook the form stops working. No success message, no error message.
Doesn’t it save? Nowhere, doesn’t even send to an email.
Or does it save (check in DB), but doesn’t show in the grid of saved forms?
What version of FormIt are you using? 5.0.1
Have you tried re-installing FormIt? Yep, and it didn’t help.
Have you added the hook in the &hooks= parameter of the FormIt-call? Yes, there’s recaptcha, email and this one in there.
If these questions didn’t nudge you to the solution, please provide more info,
and maybe also show your FormIt-Snippet-Call
I’m also not seeing a FormItSaveForm snippet in the manager. It is there on the MODX 2.X sites.
{'!FormIt' | snippet : [
'emailFrom' => 'noreply@domain.org',
'emailFromName' => 'SenderName',
'emailSubject' => 'Subject Example',
'emailTo' => 'me@mydomain.com',
'validate' => 'name:required,email:email:required,genre:required,demo:required,gdpr:required,rules:required',
'hooks' => 'recaptchav3,email,FormItSaveForm ',
'validationErrorMessage' => 'A form validation error occurred. Please check the required fields and try again.',
'successMessage' => 'Thank you for your application. We will get back to you as soon as possible.',
'submitVar' => 'contactform',
'emailTpl' => '@FILE email/contact_mail.tpl',
]}
Did you try if it works without the space at the end of the string?
This is normal for your version of FormIt.
I tested the FormItSaveForm hook on MODX 3.0.3 with FormIt 5.0.1-pl and PHP 8, and I couldn’t reproduce the issue.
{'!FormIt' | snippet : [
'hooks' => 'FormItSaveForm',
'successMessage' => 'Thank you for your application. We will get back to you as soon as possible.'
]}
Looks like it stops working, when the recaptchav3 hook is present.
I’ve also tried using the formFields parameter to eliminate any issues with the field itself saving, but it hasn’t helped.
But when you use the “recaptchav3” and the “email” hook without the “FormItSaveForm” hook everything works? So the problem is the combination of the “recaptchav3” and the “FormItSaveForm” hooks?