How to set Reply-To with both User's Name and Email?

Hi everyone,

I’m hoping someone can help me with a notification setup that I can’t seem to get working correctly.

My Goal: I want to configure the admin notification so that when I receive it, I can simply click the “Reply” button in my email client (like Gmail) and have it automatically address the new email to the person who submitted the form. The format should be User's Name <``users_email@address.com``>.

My Setup: In my Admin Notification settings, I have it configured like this:

  • From Name: My Website Name (This is static text)

  • From Email: {admin_email}

  • Reply-To: {Name} <{Email:5}>

The Problem: Even with these settings, when I receive the email and click reply, the “To:” address in my new email is the {admin_email} address, not the user’s name and email from the Reply-To field. It seems like the Reply-To header is being ignored.

My Question: Is there a mistake in how I’ve formatted the Reply-To field? Has anyone run into this issue before, or is there a different, more reliable method to achieve this?

Any advice would be greatly appreciated. Thanks in advance!

In order to set a name for the reply-to address, you need to hook into gform_pre_send_email to set the specific value. Something like the following code would accomplish this.

add_filter( 'gform_pre_send_email', function( $email, $format, $notification, $entry ) {

    if ( $entry['form_id'] == '410' && $notification['id'] == '60ec87a8547f8' ) {

        $email['headers']['Reply-To'] = "Reply-To: {$entry['3.3']} {$entry['3.6']} <{$entry['4']}>";

    }

    return $email;

}, 10, 4 );

Note that you would need to explicitly identify the form ID and notification ID on which you’re running this and enter the specific field IDs you want to be populating the reply-to field with.

Gravity Forms has no control over what happens when you click the Reply button in any software that is used to reply to the email. That behavior will be handled by the specific mail client software being used to read and reply to the message. Mail clients will not always respect the setting. You can read more about this and see a few tips in this article – Reply-To field ignored by email client – Samuel Aguilera