Skip Navigation

[Resolved] Which CRED API hook to use, after notification

This support ticket is created 7 years, 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by tinaH 7 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#541619

I would like to know which CRED API hook I should use if I want to create a function for a CRED create USER form that should execute after user is created AND CRED (on submit) notification is sent.
cred_save_data or cred_submit_complete or cred_success_redirect

#541866

Dear Tina,

There isn't such a built-in action hook within CRED plugin, see our CRED document:
https://toolset.com/documentation/programmer-reference/cred-api/

If you agree, we can take it as a feature request, our developers will evaluate it, currently I suggest you try the action hook
cred_save_data
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
Or cred_submit_complete
https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete

#542145

Do you mean that all the hooks I mention occur before Crede - on submit - notifications are sent?

#542252

No, I mean there isn't a action hook after the email is sent successfully, but the action hook cred_submit_complete is triggered after send the email notification, but the email notification might failed to be be sent.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete

See source code of CRED plugin, file \cred-frontend-editor\application\models\form\post.php line 45~61:


		// enable notifications and notification events if any
		$this->notify( $post_id, $attachedData );
...
		/* Add cred_submit_complete_form_ hook in CRED 1.3 */
		$form_slug = $form->getForm()->post_name;
		do_action( 'cred_submit_complete_form_' . $form_slug, $post_id, $thisform );
		do_action( 'cred_submit_complete_' . $form_id, $post_id, $thisform );
		do_action( 'cred_submit_complete', $post_id, $thisform );
#542416

Ah, ok - got it.
Then I know I can use cred_submit_complete, at least it runs after notification 🙂
Maybe you can add a feature request for "after notification" action hook?