Skip to content

Instantly share code, notes, and snippets.

@leepettijohn
Last active September 11, 2017 05:24
Show Gist options
  • Save leepettijohn/5eeb1918db6c35edab0f12a62b055c6c to your computer and use it in GitHub Desktop.
Save leepettijohn/5eeb1918db6c35edab0f12a62b055c6c to your computer and use it in GitHub Desktop.
Gravity Forms - Add names to BCC field
<?
//source: https://www.gravityhelp.com/documentation/article/gform_pre_send_email/#4-copy-to-to-bcc
add_filter( 'gform_pre_send_email', function ( $email, $message_format, $notification ) {
if ( $notification['name'] != 'User Email' ) {
return $email;
}
$email['headers']['Bcc'] = 'Bcc: ' . $email['to'];
$email['to'] = 'name@somedomain.com';
return $email;
}, 10, 3 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment