jimlongo
(jimlongo)
June 30, 2026, 10:31pm
1
Is it possible to have conditional logic that changes the BCC field on notifications.
I have a form with multiple (4) Send To configurations depending on certain conditions.
I’d like to also extend that to the BCC field. Is that possible? Is there a hook for that field that I can access in a function?
jimlongo
(jimlongo)
June 30, 2026, 10:44pm
2
In short the condition in psuedo code would be
if ($select_house_league == 'WEDNESDAY'){
$conditional_address = "clubhouse@tennnis.com";
$conditional_bcc = $original_bcc,$conditional_address;
}
richardw8k
(Richard Wawrzyniak (Gravity Forms))
July 1, 2026, 7:09am
3
This can’t be done via the notification settings page, but you can conditionally set the BCC just before the notification is sent by using the gform_notification filter. See the following page of the documentation for usage examples:
jimlongo
(jimlongo)
July 1, 2026, 6:01pm
4
Thanks Richard!
add_filter( 'gform_notification_24', 'add_wednesday_bcc', 10, 3 );
function add_wednesday_bcc( $notification, $form, $entry ) {
// Safely check if the submitted value for Field ID 3 is exactly'WED'
if ( isset( $entry['3'] ) && trim( (string) $entry['3'] ) === 'WED' ) {
$bcc_email = 'another.email@gmail.com';
// If there are already BCC addresses, append this one
if ( ! empty( $notification['bcc'] ) ) {
$notification['bcc'] .= ', ' . $bcc_email;
} else {
$notification['bcc'] = $bcc_email;
}
}
return $notification;
}