WPForms: add BCC email header to notification emails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpforms_email_headers', function ( $headers, $emails ) { | |
// APPLY THE BCC TO THIS FORM ID ONLY. | |
// CHANGE THE ID TO THE FORM YOU NEED. OR REMOVE THE WHOLE IF BLOCK IF NEEDED FOR ALL FORMS. | |
if ( 384 !== $emails->form_data['id'] ) { | |
return $headers; | |
} | |
// CHANGE THIS EMAIL ADDRESS TO YOURS: | |
$bcc_email = 'test@example.com'; | |
$headers .= "Bcc: $bcc_email\r\n"; | |
return $headers; | |
}, 10, 2 ); |
Hi- I wanted to try this, but where do I put the file? Thanks!
I think it should go intp functions.php file
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi- I wanted to try this, but where do I put the file?
Thanks!