bookmark_bordergform_notification_events

Description

Use this filter to add a new event to the drop down of available triggers for notifications. Additional code is necessary to handle the event since this hook only adds it to the Event drop down on the notifications admin page.

Usage

add_filter( 'gform_notification_events', 'add_event' );

Parameters

  • $notification_events array

    An array of notification events.

    	$notification_events = array( 'form_submission' => esc_html__( 'Form is submitted', 'gravityforms' ) );
    	if ( rgars( $form, 'save/enabled' ) ) {
    		$notification_events['form_saved']                = esc_html__( 'Form is saved', 'gravityforms' );
    		$notification_events['form_save_email_requested'] = esc_html__( 'Save and continue email is requested', 'gravityforms' );
    	}
    

  • $form

    The current Form object.

Examples

1. User Registered Event

This example adds the trigger “User is registered” to the Event drop down on the Notifications page.

add_filter( 'gform_notification_events', 'add_event' );
function add_event( $notification_events ) {
    $notification_events['user_registered'] = __( 'User is registered', 'gravityforms' );
    return $notification_events;
}

2. Manual Notification Event

This example (by Gravity Wiz) adds the “Send Manually” notification event. This can be used in combination with the Resend Notifications feature to manually email users have submitted your form on demand. Read the full tutorial for details.

add_filter( 'gform_notification_events', 'gw_add_manual_notification_event' );
function gw_add_manual_notification_event( $events ) {
	$events['manual'] = __( 'Send Manually' );
	return $events;
}

3. Payment Notification Events

See the Send notifications on payment events article for code snippets for sending notifications when various payment related events occur.

Placement

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

Source Code

This action hook is located in GFNotification::get_notification_events() in notification.php