Alter Gravity Form Notification E-mails

In case you need to dynamically populate the e-mail notifications for your forms, you can make modifications with the gform_notification filter. The example below allows you to modify a specific form (form id 7), or you can leave off the “_7” at the end to target all forms for the site.

I’ve used this to set additional BCC email addresses for a select list of emails in a category by assigning the array value $notification[‘bcc’]. You also have access to the form values. I found this usefully to give multiple forms a specific value in the title to target only those forms for assigning additional email addresses to the forms.


add_filter( 'gform_notification_7', 'route_notification', 1, 2 ); 
function route_notification($notification, $form , $entry) {
    global $post;
    $email_to = get_post_meta($post->ID, 'emailaddress', true);
    if ($email_to){
        $notification['to'] = $email_to;
    }
    return $notification ;
}

refernce: http://www.shilling.id.au/2013/04/08/gravity-forms-notifications-route-to-an-email-that-is-stored-in-a-custom-field/

Scroll to Top