Contact Form 7 Data to Whatsapp Link

This is not easy to achieve. Basically you need to store your submitted data and make it available on your redirected page.

TO achieve this you can use the plugin Post My CF7 Form which allows you to store the submitted data as a post (which can delete once the redirection is complete, or store the data for later reference) and then add the following to 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;
}

this will basically redirect your submitted form to your page URL defined on the first line (in this example ‘/submitted’, so you can set that to whatever you want.

On the submitted page template, you can now access the saved post with the following function,

if(isset($_GET['cf72post'])){
  $post_id = get_transient($_GET['cf72post']);
  $cf7Post = get_post($post_id);
  $whatsapp_text = $cf7Post->post_content;
  echo '<p>The following message will be sent to WhatsApp in 3 seconds:</p>';
  echo '<p>'.$whatsapp_text.'</p>';
  echo '<form name="whatsappForm" action='/submitted'><input type="hidden" name="submitted-post-id" value="'.$post_id.'"/></form>';
  echo '<script type="text/javascript">window.onload=function(){ 
    window.setTimeout(function() { document.whatsappForm.submit(); }, 3000);
};</script>';
}else if(isset($_POST['submitted-post-id'])){
  //the page is now being reloaded after 3 secs and you have the original data submitted data saved as the post_id.
  $post_id = $_POST['submitted-post-id'];
  $cf7Post = get_post($post_id);
  $whatsapp_text = $cf7Post->post_content;
  //send your $whatsapp_text to your whatsapp link
  // delete your $cf7Post if you don't need it.
}