Skip Navigation

[Resolved] Notifications issue with Edit forms

This thread is resolved. Here is a description of the problem and solution.

Problem:
Client has added a notification to an Edit Form which changes the post status to published which should be sent when the status is changed to publish, but it doesn't fire the first time, only if the same post is edited again.

Solution:
The notification on the edit form should be set to send when the form is submitted, or the notification should be added to the form where the post is initially published rather than the edit form.

Relevant Documentation:
https://toolset.com/documentation/user-guides/automated-email-notifications-with-cred/

This support ticket is created 6 years, 5 months 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 5 replies, has 2 voices.

Last updated by PiotrO586 6 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#949364

Hi,

here's the workflow I use on my website, which however doesn't trigger notification when I expect it should:

1. Contributor submits a post with Pending Review status.
2. Manager has a form where he can edit the post, which after the form submission has Published status. The form submission has notification set up; the notification should be sent to the post Author (here, Contributor) when the post status changes to Published. However, this notification doesn't work at this stage.
3. Yet the Manager has another form to manage posts: the form that changes post status back to Pending Review. When I submit this form (after I already submitted the form from step 2., so the post has Published status before submission and Pending Review upon submission) and then I submit the form from the above step 2. again (post status = Published) the notification is however sent this time.

#950198

Nigel
Supporter

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

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

Hi Piotr

I think the problem is that the form in step 2 is set to send a notification when the status changes to published, but when you submit that form the status *is* published.

You can solve this by either leaving the notification in the form in step 2 but changing it to be triggered when the form is submitted (which itself sets the status as published), or you can move the notification to the original form in step 1 and set it to be sent when the status changes to published (which will happen in step 2).

Either of the above should have it work how you expect.

#950342

Hi Nigel,

When the Contributor submits the form (step 1) the post has Pending Review status. Then the Manager edits the post (step 2) (the post has still Pending Review status before the form submission, right?) and submits it, which subsequently causes the post has status of Published, so the status changes to Published and so the notification should be triggered, or am I missing something at this point :)?

#950349

Nigel
Supporter

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

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

Well from what you experience (I tested it and found the same) it seems that the test for changing post status happens after the form has been submitted, so would only be picked up on subsequent changes to the post status, not with whatever status is set when the form is submitted. That's what the "When the form is submitted" option is for, but in any case it probably makes more sense to add such a notification based upon a change in status to the initial form. Then the notification would be sent whether the status is changed by an edit form, or directly in the backend.

#950369

Ok Nigel, so apparently I must play around it. I'll let you know whether I managed to solve it.

#951468

I played around with notifications and it appears that, as you suggested, to have a working notification triggered when post status changes I have to set it up "one form ahead", so not in the form for editing post in my case (step 2), but in the form for adding the post (step 1). Not how I would expect it to be, but at least it works now. Thanks for your tips Nigel.