clevyr,
Following is a code snippet that you can try. Place it in your theme's function.php. You will need to replace the form id in the add_filter call with your form id (i.e. 18 in gform_notification_email_18).
add_filter( 'gform_notification_email_18', 'route_notification', 10, 2 );
function route_notification($email_to, $entry) {
//1- Read location id from query string parameter "location_id"
$location_id = $_GET["location_id"];
//2- Create a key/value array with the location id (key) and the emails that will be sent (value).
//To send to multiple people, simply separate multiple emails with a comma (,)
$emails = array("1" => "email_1@test.com",
"2" => "email_2@test.com, email_2b@test.com",
"22" => "email_22@test.com"
);
//3- Lookup the array above to find which email(s) the notification need to be sent to.
$email_to = $emails[$location_id];
//4- Return the email(s) so that they are used for the notification
return $email_to;
}
Posted 14 years ago on Thursday January 7, 2010 |
Permalink