add_action( ‘wp_footer’, ‘mycustom_wp_footer’ );
function mycustom_wp_footer() {
if(is_page(“public”)){
?>
<script type=”text/javascript”>
document.addEventListener( ‘wpcf7mailsent’, function( event ){
location = ‘/thank-you/’;
}, false );
</script>
<?php } else if(is_page(“publicen”)){ ?>
<script type=”text/javascript”>
document.addEventListener( ‘wpcf7mailsent’, function( event ){
location = ‘/thank-you-en/’;
}, false );
</script>
<?php
}
}