Hello,
Having a bit of trouble trying to get custom routing working. I get no errors, but I also do not get the email notifications.
I have two address fields and I need to get the state from each. If neither of these fields are Illinois, it should route to emailone@email.com else send to emailtwo@email.com.
Here is my filter and function:
add_filter("gform_notification_2", "route_notification", 10, 3);
// gform_notification_2 is form ID 2
function route_notification($email_to, $entry) {
global $post;
$fromstate = $entry["4.4"]; //the first number (4) is address field id, the second number is the state field id in the address field.
$tostate = $entry["12.4"] ; //the first number (12) is address field id, the second number is the state field id in the address field.
if ($fromstate != "Illinois" || $tostate != "Illinois") {
$email_to = 'emailone@email.com';
} else {
$email_to = 'emailtwo@email.com';
}
return $email_to;
}
Any assistance would be greatly appreciated. I think my main concern/issue is that I may not be getting field values correctly.