CARVIEW |
Select Language
HTTP/2 301
date: Sun, 12 Oct 2025 05:02:45 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
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
x-redirect-by: WordPress
fastcgi-cache: HIT
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=21%2FWKm0yGt2qiEY5sKyTJ2hWm2kSP2obfkXd3XKrOkcctaoMqUeUutc1MokBpEBu07Tsm4rNoWGPwLd9FX%2BqXU%2BFYmKDdPNiuFY6eLJfxCL5xlym"}]}
cf-ray: 98d40bfa5809ccbb-BLR
HTTP/2 200
date: Sun, 12 Oct 2025 05:02:46 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
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: EXPIRED
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=QHx1Mv3HgDobInAXTmi%2FgcsDS%2BlKjQq6sZANIYCeLPNeZJjrSbIWiTka8PuBqRjilrdbL3wMhtiqi0z83VJC%2BskMjBksGmi7NMKQU569uijRBiwh"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 98d40bff2d01ccbb-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 `site={site_url}` |
$notification | array | The current notification object. |
$entry | array | The current entry object. |
Examples
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() . ", 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