I have a Custom Post Type that is connected to a CRED form. Users Submit details, including their email. Once submitted the post is set to pending and an admin need to approve it. Once approved - it is set to "Published".
I need that once the post is set to publish, an email will be sent to the email that was fed to the CRED from during form submission.
How can I accomplish that?
CRED Is a Front End Editor.
It is not intended to be used to customise or perform actions on the Backend.
What you can do is create a second CRED form to edit those Posts.
This CRED form is set to publish the post on submission.
It has a Notification set up to send an email to the Email stored in the Email field you let the user fill when he/she submits the Form.
Here is how to create the CRED Form:
https://toolset.com/documentation/user-guides/creating-cred-forms/
This is how you set up a Email Notification:
https://toolset.com/documentation/user-guides/automated-email-notifications-with-cred/
In the current setting I can't use this solution.
Is there a hook or action I can hook to once a CTP changes his status to "publish"?
You can try this:
1. Set the CRED Form notification with which the User actually submits the Post to_
When post status changes to: Published
2. The CRED form itself sets the Post to any but the published Status when submitting the Form
3. Once you publish the Post, even if in the backend, it should still trigger the Email