Catch data on submit to transfer into another db
-
Hello,
I’m really interested in using this plugin and I wondered if it is possible to somehow catch the data via a hook in php when the form is submitted without interfering the email. I saw in the API that it is possible to get form data in an array with an ID after the form has been submitted, but is it also possible to get the array right after the form is submitted, so without asking with the ID?To be exact: is it possible to somehow catch the form data after submit in your Forminator Plugin? So one could save them into an external database without saving to the wordpress db and then requesting it? So on submit run script with data from the form.
As already suggested by the social media team, here are some way to go.
1) First option would be to disable form submission storage on the database from the form settings and using Zapier integration to send data to an external database.
2) The second option would be to create a new extension using the API. We have detailed docs here:
https://premium.wpmudev.org/docs/api-plugin-development/forminator-api-docs/
3) The third option would be to use forminator:form:submit:success hook to post formData to any other database
I would prefer the second or last option. Therefore my question is, how do I hook the submitted data? Which variables are already set and how can I read the submitted form data?
add_action( 'forminator:form:submit:success', function ($form) { $formid = $form['ID']; if($formid == 3000){ include("../xyz.php"); } //how do I get the ID or the form data from this hook? The function above shows would I like to do at the end and then use the data in the included php file via $form['name']; etc... });
Many thanks!
#Info: I closed the other topic to make the thread cleaner
- The topic ‘Catch data on submit to transfer into another db’ is closed to new replies.