The gform_notification_note filter allows you to modify the note(s) being added to the entry detail page that contain the sending result of notifications for the entry.
Usage
add_filter('gform_notification_note', 'your_custom_function', 10, 6); function your_custom_function($note_args, $entry_id, $result, $notification, $error_info, $email) { // your custom code here return $note_args; }
Parameters
- $note_args (array): Array containing text, type, and subtype for the note.
- $entry_id (int): ID number for the entry being processed.
- $result (bool): The result returned by
wp_mail()
. - $notification (array): The notification properties. See Notifications Object for possible properties.
- $error_info (string): Additional details for notifications with errors.
- $email (array): Array containing email details.
More information
See Gravity Forms Docs: gform_notification_note
Examples
Customize the result note with custom text
This example modifies the note text when the email is successfully sent.
add_filter('gform_notification_note', 'custom_sending_result_note', 10, 6); function custom_sending_result_note($note_args, $entry_id, $result, $notification, $error_info, $email) { if ($result === true) { $note_args['text'] = "Amazing! WordPress sent the email to: " . $email['to']; } return $note_args; }
Disable all notes
This example prevents notes from being added to the entry for all notifications.
add_filter('gform_notification_note', '__return_empty_array');
Disable notes for specific notification
This example prevents notes from being added to the entry for notifications with a specific name.
add_filter('gform_notification_note', 'gf_disable_notification_notes', 10, 6); function gf_disable_notification_notes($note_args, $entry_id, $result, $notification, $error_info, $email) { if (rgar($notification, 'name') === 'The notification name here') { $note_args = array(); } return $note_args; }
Note: Place the code in the functions.php
file of your active theme.
Version: This filter was added in Gravity Forms version 2.4.15.