Created
October 16, 2017 15:49
-
-
Save slaFFik/6ebf5c860e9e9b053a64f264a08f019b to your computer and use it in GitHub Desktop.
WPForms: add BCC email header to notification emails
This file contains hidden or 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 = '[email protected]'; | |
$headers .= "Bcc: $bcc_email\r\n"; | |
return $headers; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes this goes in your functions.php file @Bobswesternshirt and @bitridge and if you want it to do all forms you'd simply clear the condition