Description
This filter is executed before sending the user notification email. It can be used to route the notification to a different email address
Usage
Applies to all forms
<?php
add_filter("gform_autoresponder_email", "change_notification_email", 10, 2);
?>
Applies to a specific form. In this case, form Id 5
<?php
add_filter("gform_autoresponder_email_5", "change_notification_email", 10, 2);
?>
Parameters
- (string) The email address to be filtered.
$form
- (Form Object) The current form.
Examples
This example uses the gform_autoresponder_email filter to send the user notification to a test email address
<?php
add_filter("gform_autoresponder_email", "change_notification_email", 10, 2);
function change_notification_email($email, $form){
//applying notification routing to form Id 2
if($form["id"] != 2)
return $email;
//creating email list from fields 2 and 3.
return $_POST["input_2"] . "," . $_POST["input_3"];
}
?>
Source Code
This filter is located in form_display.php