I want to build a custom email notification add-on for Gravity Forms that enables multiple or compounded email notification routing configuration conditions.
Here is a perfect example request from the Community and a well answered ‘hook’ based proposal by Faisal Ahmed:
add_filter( ‘gform_notification’, ‘change_notification_email’, 10, 3 );
function change_notification_email( $notification, $form, $entry ) {
$practice_area = rgar( $entry, ‘2’ );
$county = rgar( $entry, ‘3’ );
if ($practice_area == “Business Law” && $county == “Sussex”) {
$notification[‘to’] = “email-1@example.com”;
} elseif ($practice_area == “Business Law” && $county == “New Castle”) {
$notification[‘to’] = “email-2@example.com”;
} elseif ($practice_area == “Nursing Law” && $county == “Sussex”) {
$notification[‘to’] = “email-3@example.com”;
}
return $notification;
A fully-functioning solution that does what I want is a far stretch on the example above – but I think Faisal’s approach is the right one.