Suppressing the Notification

If you want to suppress the Notification from an external script, you can do it with an action:

add_action( 'notification/notification/pre-send', function( $notification, $trigger ) {
	
	if ( $notification->get_slug() == 'email' ) {
		$notification->suppress();
	}

}, 10, 2 );

You can target any Notification or Trigger property in this action.

1 person considered this helpful