Skip Navigation

[Resolved] email notification from post form unreliable – sporadic success

This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 5 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1214095

I am trying to: send a confirmation email to the user after they have completed a registration form

Link to a page where the issue can be seen: hidden link

I expected to see: an email every time, or a log entry (using Post SMTP Email Log plugin)

Instead, I got: some emails, some log entries but not reliable and no obvious pattern

I've searched and been through all the existing support tickets with similar issues, and tried the obvious things but this is very random whether it works or not. It seems that if the email is logged then it's received by the user but some are just not logged which would indicate that the email isn't even getting out. This form goes live soon and it is pretty crucial that information is sent to the user.

Can you suggest any alternative method of triggering something – this could be done manually if need be, the form is a call for entries so open up for a limited time.

Using latest versions of WP and Toolset plugins.

#1214303

Hi, just to be clear, are you saying that the post is created but the notification is not sent? Or is the post not created successfully but a success message is displayed?

If the problem is seemingly random that tends to indicate one of these:
- A server compatibility problem. We currently have another open ticket where the client is experiencing notification issues. Their hosting company is also using a LiteSpeed webserver, so it could be a symptom of the same problem: https://toolset.com/forums/topic/cred-post-form-emails-not-sending
We are hoping to hear back from that host by early next week with some additional information.

- A caching issue, either at the server level or at the plugin level. Try temporarily disabling any caching plugins or server-side caching implementations, then try to replicate the dropped notification problem.

- An SMTP issue. Try disabling the SMTP plugin and activating something like WP Mail Logging that doesn't rely on an SMTP implementation. Try to replicate the dropped notification problem.

Try editing and resaving this Form at least once. Sometimes regenerating the notification handlers by resaving the Form will fix some minor issues in the database.

You could also check the server logs to see if any errors have been registered recently. If you're not familiar with server logs, I can show you how to activate them temporarily. Go in your wp-config.php file and look for

define('WP_DEBUG', false);

Change it to:

define('WP_DEBUG', true);

Then add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

Submit the Form until you experience a dropped notification. If any backend errors were registered, this will create an error_log.txt file in your site's root directory. Please send me its contents. Once that is done, you can revert the changes you made to wp-config.php and delete the log file.

#1214733

Hi Christian
I typed a detailed response only to be logged off when submitted and lost it. So in summary, did what you suggested re caching, SMTP plugin and resaving form. Set up debug in wp-config but nothing there. Implemented the noAbort directive as per the other thread. And yes, posts created ok, success notification ok on screen – just the emails not coming through 100%.

Have put through 30 tests, approx 1 in ten not being logged in WP Mail Logging and email not received. With two notifications set up the second one rarely logged or received, even though the first received in much the same ratio.

My hosting uses LiteSpeed, any further forward on that front?

#1215542

It seems that the problem in the other ticket was difficult to replicate reliably, and there were two workarounds offered - one was an .htaccess modification as you noticed, and the other was to change the Form settings to "keep displaying this form" instead of using redirects. Can you tell me if changing the redirect to "keep displaying this form" causes any noticeable differences in the delivery / logging of mails?

If not, then I think the next step is to create a new "Create Artist Post" Form. Add your email notification to this new Form, but don't modify the automatically generated Form code or add any custom JavaScript. Then test this new Form to see if the same dropped notifications occur. If not, we can try to pin down which specific part of the old Form is causing the drops. Do you have a test environment available?

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.