Hi @ronnyvanderborght
I hope you are doing great today!
This is an expected behavior, the form will only validate if users enters correct details (e.g valid email address). It is the responsibility of the web admin to make sure that all settings to get the email delivered to them about form submission is done correctly.
I hope this helps. However, if there is a workaround the support team will reach out to you soon.
Kind regards,
Olumide
Dear Olumide,
Thank you for your reply. This is a big issue. There can always be some kind of issue with an smtp service (technical or even a simple password change that is not mentioned to the site admin, that happens a lot) and then new submissions will go unnoticed.
At least there should be a setting in Forminator the modify this behaviour.
I hope the support team can provide a workaround because I’m sure this will be an issue for a lot of Forminator users that are currently unaware about this default behaviour. If it ‘always submits’ there is even no way in verifying that smtp setting are good. You could argue that when the notification email does not get received the settings are wrong, but that is not always the case. There are at least 5 other things that could prevent an e-mail notification not arriving…
Hi,
Any word yet from the support team ?
Hi @ronnyvanderborght,
Sorry for the delay in getting back to you.
This is an expected behaviour, as the Forminator will validate the form and check if the values have been successfully saved to the database.
However, I have pinged our developers to check if a workaround could be suggested for this and we’ll update you here once we have feedback on this as soon as possible.
Kind Regards,
Nebu John
Hi @ronnyvanderborght,
We’ve added a task in Forminator’s backlogs to explore the possibility of implementing an improvement for this within the plugin.
In the meantime, could you please check if the following workaround proves helpful while we actively work on enhancing the functionality?
<?php
add_action( 'forminator_custom_form_mail_admin_sent', 'wpmudev_remove_entry_mail_fail', 10, 5 );
function wpmudev_remove_entry_mail_fail( $mail_cls, $custom_form, $data, $entry, $recipients ) {
if ( did_action('wp_mail_failed') ) {
$entry->delete();
wp_send_json_error(
array(
'message' => esc_html__( 'Mail Sending Failed. Please try again.', 'forminator' ),
)
);
}
}
Before implementing the code on the live website, please test it in a staging or development environment. I hope this suggestion proves helpful.
Kind Regards,
Nebu John
Dear John,
I tested your function and at first sight it seems to do the trick.
Thanks for your help. I hope this gets merged soon in Forminator as a setting.
Hi @ronnyvanderborght,
We are happy to hear that the issue has been resolved and marking this thread accordingly.
Please let us know in case you need further help.
Kind regards,
Zafer