Interface
Notification Module Interface
All Notification modules must implement this interface
public function 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', ], ];
Returns array
public function isActive()Is this notification provider active?
Returns bool
public function getName()Returns bare class name of the specific notification module. EX. 'Hipchat' or 'Aim' or 'MyMessageModerator'
Returns string
public function getDisplayName()Get display name for the notification module.
Returns string
public function 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'
Returns string
public function testConnection($settings)Routine to validate settings for activation/configuration of notification provider
Parameters
| Type | Name | Description |
|---|---|---|
array | $settings |
Returns bool — Return true for success
public function 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, ], ]
Returns array
public function getDynamicField($fieldName, $settings)Retrieve option values used to populate a 'dynamic' Type notification setting
Parameters
| Type | Name | Description |
|---|---|---|
string | $fieldName | Notification setting field name |
array | $settings | Settings for the module |
Returns array
public function sendNotification(NotificationInterface $notification, $moduleSettings, $notificationSettings)Deliver notification
Parameters
| Type | Name | Description |
|---|---|---|
NotificationInterface | $notification | A notification to send |
array | $moduleSettings | Configured settings of the notification module |
array | $notificationSettings | Configured notification settings set by the triggered rule |