Skip Navigation

[Closed] Form doesn't always send second e-mail

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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 3 replies, has 3 voices.

Last updated by Mateus Getulio 4 months ago.

Assisted by: Mateus Getulio.

Author
Posts
#2725696

We're using a form that sends an e-mail after submitting it. That always works. However, it should also send an e-mail if the post status is changed to published, and that doesn't always work. It does sometimes though... see this video: hidden link

#2725796

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Thanks for sharing the video.

Do you have any information about how the submitted posts are changed to Published?

I can imagine that there is a workflow that is followed where a post is submitted, presumably it is a draft post until it has been reviewed somehow, and then the post is updated to publish it. And perhaps that same workflow is typically followed, and the second email is sent, but there are other ways that the status of the post gets changed to published, and those emails do not get sent.

I'm trying to think of what the difference between the successful scenario and the unsuccessful scenario might be.

Do you have any ideas?

#2727058

Hi Nigel,

According to the client, the procedure is always the same. Someone fills in the form, the post is created as a private post, the first e-mail is sent, that all works as expected. Then the client manually changes the post status to published, which should trigger the second e-mail. That works most of the time, and has worked for years, but lately it doesn't always work anymore...

#2727430

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

It is strange that one emails always work and the other is intermittent.

It looks like you use Post SMTP, right? Just as a test, is it possible for you to temporarily switch to a different option such as Easy WP SMTP https://wordpress.org/plugins/easy-wp-smtp/ to see if the issue is fixed?

We've had mailing issues in the past that were fixed by switching to a different SMTP plugin.

Also, can you please temporarily enable WordPress debugging and then include this custom code in the website?
( ref: https://wordpress.org/documentation/article/debugging-in-wordpress/ )


add_filter('cred_notification_recipients', 'custom_recipients_check', 10, 4);
function custom_recipients_check($recipients, $notification, $form_id, $post_id) {
	// Check notification name matches target notification
	if ( isset($notification['name']) && 'Confirm Container' == $notification['name'] ) {
		error_log(print_r($recipients,true));
		error_log('===========================================');
	}
	return $recipients;
}

The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.

It will output the list of 'recipients' for the form notification in question, in the error log. Also, if you see any other errors/warnings related to form notification, please also share them with us.

The topic ‘[Closed] Form doesn't always send second e-mail’ is closed to new replies.