gform_notification_note

Description

Use this filter to modify the note(s) being added to the entry detail page that contain the sending result of notifications for the entry.

Parameters

  • $note_args array

    Array containing text, type and subtype for the note.

  • $entry_id int

    Id number for 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 error.

  • $email array

    Array containing email details.

Examples

Customize the result note with custom text

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 ){
	  $result_note['text'] = "Amazing! WordPress sent the email to: " . $email['to'];
	}
    return $result_note;
}

Disable all notes

The following example will prevent notes from being added to the entry for all notifications.

add_filter( 'gform_notification_note', '__return_empty_array' );

Disable notes for specific notification

The following example will prevent notes from being added to the entry for all 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;
}

Placement

This code should be placed in the functions.php file of your active theme.

Since

This filter was added in Gravity Forms version 2.4.15

Source Code

This filter is located in GFFormsModel::add_notification_note in forms_model.php: