Skip to content

Commit

Permalink
Merge pull request #2083 from CalderaWP/feature/1504
Browse files Browse the repository at this point in the history
Fixes BCC visible to Email Recipients #1504
  • Loading branch information
Shelob9 committed Nov 21, 2017
2 parents 69c35e2 + 6156355 commit 51e8d0d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions classes/core.php
Expand Up @@ -1085,14 +1085,14 @@ public static function send_auto_response( $config, $form ) {
}


$email_message['bcc'] = false;
if ( ! empty( $config[ 'bcc' ] ) ) {
$email_message['bcc'] = Caldera_Forms::do_magic_tags( $config[ 'bcc' ] );

$bcc_array = array_map('trim', preg_split( '/[;,]/', Caldera_Forms::do_magic_tags( $config[ 'bcc' ] ) ) );
foreach( $bcc_array as $bcc_to ) {
if ( is_email( $bcc_to ) ) {
$email_message['headers'][] = 'Cc: ' . $bcc_to;
$email_message['cc'] = false;
if ( ! empty( $config[ 'cc' ] ) ) {
$email_message['cc'] = Caldera_Forms::do_magic_tags( $config[ 'cc' ] );

$cc_array = array_map('trim', preg_split( '/[;,]/', Caldera_Forms::do_magic_tags( $config[ 'cc' ] ) ) );
foreach( $cc_array as $cc_to ) {
if ( is_email( $cc_to ) ) {
$email_message['headers'][] = 'Cc: ' . $cc_to;
}
}
}
Expand Down

0 comments on commit 51e8d0d

Please sign in to comment.