Using Gravity Forms ‘gform_post_notification_save’ PHP action

The gform_post_notification_save action fires after a notification is successfully saved in Gravity Forms.

Usage

add_action('gform_post_notification_save', 'your_function_name', 10, 3);

Parameters

  • $notification (Notifications Object): The notifications object.
  • $form (Form Object): The current form.
  • $is_new_notification (bool): True if this is a new notification. False otherwise.

More information

See Gravity Forms Docs: gform_post_notification_save

This action was added in Gravity Forms version 1.9.16 and is located in GFNotification::notification_edit_page() in notification.php.

Examples

Notify admin when a new notification is created or updated

This example sends an email to the admin when a new notification is created or updated for a form.

add_action('gform_post_notification_save', 'notification_saved', 10, 3);

function notification_saved($notification, $form, $is_new_notification) {
    if ($is_new_notification) {
        $message = 'A new notification was created for form id ' . $form['id'] . ' - ' . $form['title'];
    } else {
        $message = 'A new notification was updated for form id ' . $form['id'] . ' - ' . $form['title'];
    }
    GFCommon::send_email('[email protected]', '[email protected]', '', '', 'New Notification', $message);
}