Hi @dayclone, apologies I could not get back to you earlier, got caught up with a new release. The good news, is that I have introduce a simple way to solve this problem in the new version 3.1 which I have just released.
Place the following in your functions.php
file,
add_filter('cf7_2_post_form_append_output', 'redirect_on_submit', 10, 3);
function redirect_on_submit($script, $attr, $nonce){
//$attr cf7 shortcode attributes to check if this is the correct form.
$url = site_url('/submitted'); //page slug to redirect to.
$url = add_query_arg( array('cf72post' => $nonce,), $url);
$url = esc_url($url);
$script = '<script>'.PHP_EOL;
$script .= 'document.addEventListener( "wpcf7mailsent", function( event ) {'.PHP_EOL;
$script .= ' var save = document.getElementsByClassName("cf7_2_post_draft");'.PHP_EOL;
$script .= ' if(save.length == 0 || "false" === save[0].value){'.PHP_EOL;
$script .= ' location = "'.$url.'";'.PHP_EOL;
$script .= ' }'.PHP_EOL;
$script .= '}, false );'.PHP_EOL;
$script .= '</script>'.PHP_EOL;
return $script;
}
where you need to change the slug of your page to which you want to redirect.
Now the submitted form is saved to a post and its ID is stored in a transient field by the plugin. You can access this transient field with the following code in your page template,
if(isset($_GET['cf72post'])){
$post_id = get_transient($_GET['cf72post']);
echo 'form submission saved to post:'.$post_id;
}