Hi @phloo,
You can find API docs on our site here:
https://premium.wpmudev.org/docs/wpmu-dev-plugins/forminator-api-docs/
And some additional usage information on the blog post here:
https://premium.wpmudev.org/blog/how-to-build-custom-forminator-add-ons-using-the-developer-api/
Let me know if that helps with accomplishing your goal 🙂
Cheers,
Predrag
Thread Starter
phloo
(@phloo)
Thanks for the reply
There is no informations about the question I posted.
None of the API docs lists any information for the hook when a submission gets send via mail nor is there any code example for it.
So no, doesnt really help.
Hello @phloo ,
Please check our developer’s suggestion:
Use different filter:
/**
* $data - the post data
* $custom_form - the form
* $entry - saved entry
*/
add_filter( 'forminator_custom_form_mail_data', function( $data, $custom_form, $entry ){
return $data;
}, 10, 3 );
//source: forminator/library/modules/custom-forms/front/front-mail.php on line 123
like that:
/**
* array $data - the post data
* object Forminator_Custom_Form_Model $custom_form - the form
* object Forminator_Form_Entry_Model $entry - saved entry
*/
add_filter( 'forminator_custom_form_mail_data', function( $data, $custom_form, $entry ){
$checkbox_id = 'checkbox-1';
// if this checkbox is not checked
// @file_put_contents( ABSPATH .'/data.txt', "\n-------\n". print_r( $data, true ), FILE_APPEND );//use this to log the data to your root-site/data.txt file
if( ! isset( $data[ $checkbox_id ] ) ){
// do something if checkbox is not checked
}
return $data;
}, 10, 3 );
Thread Starter
phloo
(@phloo)
Hi Kasia,
thanks for the feedback and code example.
This is helpful. But I still don’t understand how you can find such examples on your documentation pages, nor do I see anything like that on your dev’s provided links in the first answer. Even the search doesn’t find any infos about this filter, etc.
Hello @phloo
I hope you are doing well!
As Kasia has mentioned in a previous thread, the code was provided by our developer 🙂
Please let us know if you will have any further questions.
Kind regards,
Nastia
Thread Starter
phloo
(@phloo)
Still testing, Nastia. But I guess we will be fine.