Skip to main content Skip to navigation Skip to footer

How to Trigger a Notification from a Toolset Types Front-end Form

Updated

If you use Toolset Types Forms and want to trigger a notification off of a front-end form, you’ll need to do so using their Forms/Cred API.
To do this:

1. Ensure the post is saved as a draft.

2. Create a custom page template that contains this code (replacing XX with your form ID, where needed):

[cc lang=”php”]

function my_success_action($post_id, $form_data) {
if ($form_data[‘id’] == XX) {
$cur_post = array(
‘ID’ => $post_id,
‘post_status’ => ‘publish’
);
wp_update_post($cur_post);
}
}
add_action(‘cred_submit_complete’, ‘my_success_action’, 10, 2);

[/cc]

3. In the settings of the Toolset Form, set a delay of 1 second for the redirection of the form after submission.

Privacy Overview

This website uses cookies so that it can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to this website and helping employees to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

This website uses the Stripe Payment Processor. Cookies from Stripe are required in order for this website to provide eCommerce functions, such as to accept payments.

This website uses YouTube to host and display videos relating to the operation of this plugin and forms part of the documentation. Use of cookies from YouTube is required in order to fully document or explain elements of a product.

PHPSESSID - This cookie is native to PHP applications. The cookie is used to store and identify a users' unique session ID for the purpose of managing a user's session on the website. The cookie is a session cookies and is deleted when all the browser windows are closed.