Description
The gform_notification_services filter can be used to add a new choice to the “Email Service” setting on the edit notification page.
Additional code is necessary to handle having the service actually send the notification email since this hook only makes the choice available to the user for selection when configuring their notifications.
Usage
The following would apply to all forms.
add_filter( 'gform_notification_services', 'your_function_name', 10, 2 );
Parameters
- $services array
An array of notification services.
$services = array( 'wordpress' => array( 'label' => esc_html__( 'WordPress', 'gravityforms' ), 'image' => admin_url( 'images/wordpress-logo.svg' ) ) );
-
$form Form Object
The current Form object.
Examples
1. Add a new service
add_filter( 'gform_notification_services', 'add_notification_service' ); function add_notification_service( $services ) { $services['the_service_name'] = array( 'label' => esc_html__( 'Your Custom Service', 'gravityforms' ), 'image' => 'http://someurl.com/image.svg' ); return $services; }
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_services() in notification.php