# WHMCS\Module\Contracts\NotificationModuleInterface

`Interface`

Notification Module Interface

All Notification modules must implement this interface

## Methods

### settings

```php
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`

### isActive

```php
public function isActive()
```

Is this notification provider active?

**Returns** `bool`

### getName

```php
public function getName()
```

Returns bare class name of the specific notification module.
EX. 'Hipchat' or 'Aim' or 'MyMessageModerator'

**Returns** `string`

### getDisplayName

```php
public function getDisplayName()
```

Get display name for the notification module.

**Returns** `string`

### getLogoPath

```php
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`

### testConnection

```php
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

### notificationSettings

```php
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`

### getDynamicField

```php
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`

### sendNotification

```php
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 |