How to redirect to another page after contact form 7 submit in wordpress

Posted on Aug 20, 2020
<?php
function cf7_footer_script(){ ?>
 
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
   
    window.location.href = 'https://api.whatsapp.com/send?phone=XXXXXX/&text=Hello world!';
}, false );
</script>
  
<?php } 
  
add_action('wp_footer', 'cf7_footer_script'); 
guest
0 Comments
Inline Feedbacks
View all comments