Description
The gravitysmtp_connector_types
filter allows you to modify the list of available connector types in Gravity SMTP. It lets you add, remove, or modify the SMTP connectors available for configuration.
Usage
add_filter( 'gravitysmtp_connector_types', 'your_function_name', 10, 1 );
Parameters
Parameter | Type | Description |
---|---|---|
$connectors | array | An array of connector types with their class names. |
Examples
Add a custom connector.
add_filter( 'gravitysmtp_connector_types', 'add_custom_connector', 10, 1 );
function add_custom_connector( $connectors ) {
$connectors['Custom_SMTP'] = 'My_Custom_Connector_Class';
return $connectors;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in includes/connectors/class-connector-service-provider.php