| CARVIEW |
Select Language
HTTP/2 301
date: Sun, 28 Dec 2025 08:37:31 GMT
content-type: text/html; charset=UTF-8
location: https://docs.gravityforms.com/gform_notification_email_header/
server: cloudflare
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
x-redirect-by: WordPress
fastcgi-cache: MISS
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=OaKb%2FBeUBuxRmpyGgwfcOMrjUdhoZaVEsWzPl5peZV4yIc%2BNCq%2BXRGqFGExegtltpf84B%2BFz%2Fzqo%2F2LRMoKk0jnvlYfeWbkN52OXpK4RhLmjyW69"}]}
cf-ray: 9b4fbc6e5e695917-BLR
HTTP/2 200
date: Sun, 28 Dec 2025 08:37:31 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
vary: Accept-Encoding
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
link: ; rel="https://api.w.org/"
link: ; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
fastcgi-cache: HIT
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=K7JNXwBcbCkK19n7OP2s2e8WoU3PNaiI4E98BFWFR4cxGurnNlh1t30A9DD5UJMMnFXdtNV6vKiCBpF1iZp%2FNyCZshnlPnOMIciWNsom9hkhLCpr"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 9b4fbc74e9785917-BLR
gform_notification_email_header - Gravity Forms Documentation
gform_notification_email_header
Description
The gform_notification_email_header filter adds the ability to enable and customize the X-Gravity-Forms-Source email header for notification emails.
Usage
Apply to all notifications for a form.
add_filter( 'gform_notification_email_header_FORM_ID', 'your_custom_function', 10, 3);
Apply to a specific notification for a form.
add_filter( 'gform_notification_email_header_FORM_ID_NOTIFICATION_ID', 'your_custom_function', 10, 3);
Parameters
| Parameter | Type | Description |
|---|---|---|
| $header | string | The source header value. Defaults to an empty string, or site={site_url} if the GF_ENABLE_NOTIFICATION_EMAIL_HEADER constant is used. |
| $notification | array | The current notification object. |
| $entry | array | The current entry object. |
Examples
Enable and set a custom header value for all forms
add_filter( 'gform_notification_email_header', function( $header, $notification, $entry ) {
return get_site_url() . ", form_id={$entry['form_id']}, notification_id={$notification['id']}, entry_id={$entry['id']}";
}, 10, 3 );
Enable and set a custom header value on a form for a specific notification.
// Replace 123 with your Form ID and 51794abf1f0d2 with your Notification ID.
add_filter( 'gform_notification_email_header_123_51794abf1f0d2', function( $header, $notification, $entry ) {
return get_site_url() . ", form_id={$entry['form_id']}, notification_id={$notification['id']}, entry_id={$entry['id']}";
}, 10, 3 );
Finding your Notification ID
When editing your notification, you will find the notification ID in the browser address bar at the very end after the ?nid= parameter:
example.com/wp-admin/admin.php?page=gf_edit_forms&view=settings&subview=notification&id=95
&orderby=name&order=desc&nid=51794abf1f0d2
The notification ID in this example is 51794abf1f0d2
Disable email header value on a form for all notifications.
// Replace 123 with your Form ID.
add_filter( 'gform_notification_email_header_123', '__return_empty_string' );
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in common.php
Since
This filter was added in Gravity Forms 2.9.13