NotificationModuleInterface
Notification Module Interface
All Notification modules must implement this interface
Methods summary
Return Type | Method Name | Description | |
---|---|---|---|
array | settings() | List of settings required for module activation/configuration | |
bool | isActive() | Is this notification provider active? | |
string | getName() | Returns bare class name of the specific notification module. | |
string | getDisplayName() | Get display name for the notification module. | |
string | getLogoPath() | Logo of provider. | |
bool | testConnection(array $settings) | Routine to validate settings for activation/configuration of notification provider | |
array | notificationSettings() | List of settings relevant to the delivery of a notification | |
array | getDynamicField(string $fieldName, array $settings) | Retrieve option values used to populate a 'dynamic' Type notification setting | |
sendNotification(NotificationInterface $notification, array $moduleSettings, array $notificationSettings) | Deliver notification |
Details
array
settings ()
List of settings required for module activation/configuration
EX. return [ 'api_username' => [ 'FriendlyName' => 'API Username', 'Type' => 'text', 'Description' => 'Required username to authenticate with message service', ], 'api_password' => [ 'FriendlyName' => 'API Password', 'Type' => 'text', 'Description' => 'Required password to authenticate with message service', ], ];
bool
isActive ()
Is this notification provider active?
string
getName ()
Returns bare class name of the specific notification module.
EX. 'Hipchat' or 'Aim' or 'MyMessageModerator'
string
getDisplayName ()
Get display name for the notification module.
string
getLogoPath ()
Logo of provider.
Publicly accessible path relative to WHMCS System URL. Expressed as "absolute" path (leading forward slash) EX. '/modules/notifications/messagemod/messagemod.png'
bool
testConnection (array $settings)
Routine to validate settings for activation/configuration of notification provider
array
notificationSettings ()
List of settings relevant to the delivery of a notification
EX. ['channel' => [ 'FriendlyName' => 'Channel', 'Type' => 'dynamic', 'Description' => 'Select the desired channel for notification delivery.', 'Required' => true, ], ]
array
getDynamicField (string $fieldName, array $settings)
Retrieve option values used to populate a 'dynamic' Type notification setting
sendNotification (NotificationInterface $notification, array $moduleSettings, array $notificationSettings)
Deliver notification