Skip to content

Instantly share code, notes, and snippets.

@erikyo
Last active January 14, 2022 13:20
Show Gist options
  • Select an option

  • Save erikyo/a270969da4ea86c6d5d8321b77e64e4d to your computer and use it in GitHub Desktop.

Select an option

Save erikyo/a270969da4ea86c6d5d8321b77e64e4d to your computer and use it in GitHub Desktop.
Contact Form 7 - replace mail content / posted data (in this example replace the email appending the support email domain)
<?php
function prefix_replace_email( $posted_data ) {
$posted_data[ 'your-email-backup' ] = $posted_data[ 'your-email' ] ;
$posted_data[ 'your-email' ] = str_replace('@', 'A', $posted_data[ 'your-email' ]) . '@mysupport.com' ;
return $posted_data;
}
add_filter( 'wpcf7_posted_data', 'prefix_replace_email' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment