# Reply Directly to People Who Fill In Gravity Forms

> Sets the Reply-To of Gravity Forms admin notifications to the email address the visitor entered, so hitting Reply answers them instead of your own site.

- Type: PHP
- Runs: Run everywhere
- Category: [Forms](https://wpide.com/library/category/forms/)
- Tags: gravity-forms, notifications, reply-to
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/gf-reply-to-submitter/

## Code

```php
add_filter( 'gform_notification', function ( $notification, $form, $entry ) {
    if ( '' !== trim( (string) rgar( $notification, 'replyTo' ) ) ) {
        return $notification;
    }

    foreach ( $form['fields'] as $field ) {
        if ( 'email' === $field->type ) {
            $email = sanitize_email( (string) rgar( $entry, (string) $field->id ) );
            if ( is_email( $email ) ) {
                $notification['replyTo'] = $email;
            }
            break;
        }
    }

    return $notification;
}, 10, 3 );
```

## Notes

Notifications that already have a Reply-To keep it; the first email field in the form is used.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Reply Directly to People Who Fill In Gravity Forms" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
