Open Gabweb opened 6 years ago
This makes sense to change. What would you want to happen if it returns false?
Anything else than a success message! I think a simple error message to the user would be great. For example, "Your message could not be deleviered. Try again or contact the page adimistrator."
As addition, but not necessary: The possibility to change the error message in the form settings.
@Gabweb That makes sense. I'm going to think about how best to do this over the weekend.
Contact Form 7 works basically like that. I don't love it as someone filling out the form. Makes me wonder how to contact admin/ why it's my problem as site visitor/ etc. But it's useful.
I wonder if it's better to only show this in the preview mode or if current user is an admin?
+1
This would especially convenient if submissions are not stored. In that case a wp_mail error leads to a lost submission. As for the message, instead of 'the page administrator' maybe use the 'admin_email' option?
yes, I need this fix. Recently an issue with newest PHP and Cloudlinux broke the wp_mail function. It was returning false. Unfortunately I didn't know about it for a long time, until a client told me they hadn't received email from their system in quite some time. There absolutely needs to be some reporting or error return that the wp_mail failed to send the email.
Versions:
WordPress Version: 4.8.6PHP Version: 7.1.7MySQL Version: 5.7.19Caldera Forms Version: 1.6.1
Does Your Issue Persist When You Disable All Other Plugins and Switch To The Default Theme?
Tested with a clean WP installation + only Caldera Forms installed.
Expected behavior:
Caldera Forms should return an error message if wp_mail returns false.
Observed behavior:
Caldera Forms always returns success. (With and without ajax)
Steps to recreate the issue:
Break the wp_mail on purpose: e.g. by using the following plugin: https://gist.github.com/Gabweb/f15d789017647ac302e744977c500780#file-break-wp-mail-php
Alternative: Replace all wp_mail(...) calls with false.