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
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
Do you mean that all the hooks I mention occur before Crede - on submit - notifications are sent?
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 );
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?