Using Gravity Forms ‘gform_notification_events’ PHP filter

The gform_notification_events filter allows you to add new event triggers to the notifications dropdown in the Gravity Forms admin page.

Usage

add_filter('gform_notification_events', 'add_event');

Parameters

  • $notification_events (array): An array of notification events.
  • $form (Form Object): The current form object.

More information

See Gravity Forms Docs: gform_notification_events

Examples

User Registered Event

This example adds the trigger “User is registered” to the Event dropdown 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;
}

Manual Notification Event

This example adds the “Send Manually” notification event, which can be used in combination with the Resend Notifications feature.

add_filter('gform_notification_events', 'gw_add_manual_notification_event');

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

Payment Notification Events

See the Send Notifications On Payment Events article for code snippets for sending notifications when various payment-related events occur.

Mailchimp API failed Notification Event

This example adds the trigger “Mailchimp API Issue” to the Event dropdown on the Notifications page for use in combination with the Mailchimp API Issue custom action example.

add_filter('gform_notification_events', function($events) {
    $events['mailchimp_api_issue'] = 'Mailchimp API Issue';
    return $events;
});

Placement

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