---
title: "Notifier | Configuration | N3uron KB V1.22"
slug: "notifier-configuration"
description: "Notifier is a N3uron module designed to enable messages containing alarms and tag values to be sent to a group of users. These notifications can be triggered…"
updated: 2025-12-23T13:48:44Z
published: 2025-12-23T13:48:44Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.n3uron.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> [!NOTE]
> **Note:**
> 
> Before starting the configuration, a new module instance must be created. [**Click here for more information about creating Module instances**](/v122/docs/platform-create-new-module-instance).

## Module Configuration

Users can configure notifications by selecting **Notifier** from the Explorer tree menu.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Newmessage.png)

As shown in the image below, a **New Message** can be created in the Model Panel by clicking on the burger menu icon. Each **message** can have several **notifiers**assigned to it.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Newmessage01.png)

## Message

The **Message** configuration section is used to configure the message content, as well as any triggers and **Notifiers**. Notifiers can be **Mail**, **SMPP**, or **Webhook**connectors that enable integration with popular communication platforms such as **WhatsApp**, **Slack**, **Discord**, **Telegram**, **Twilio**, and any other third-party system that supports Webhook endpoints.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%206.png)

### General Settings

| Setting | Description |
| --- | --- |
| Enabled | Enables or disables message processing. |
| Timestamp | Configures timestamp formatting and timezone settings for the message. This affects how timestamps are displayed in alarm and tag tables within the notification message. - **Format:** Specifies how timestamps will be parsed. Available options: - **ISO 8601:** Timestamp follows the ISO8601 standard (e.g., 1970-01-01T00:00:00+01:00). - **UNIX Epoch:**Timestamp is represented as the number of seconds elapsed since January 1st, 1970 (UNIX epoch time). - **Custom format:** Allows defining a custom timestamp format using the Format string parameter. This provides maximum flexibility for specific formatting requirements. **Format string:**Used to specify a format string used to format the timestamp. **Date tokens:** **• YYYY:** Four-digit year (e.g., 1970) **• YY:** Two-digit year (e.g., 25 refers to 2025) **• M MM:** Month as number, 1-12 (e.g., 5 refers to May) **• MMM MMMM:** Month name in English (e.g., Jan or January) **• D DD:** Day of month (e.g., 13 is the 13th day) **• DDD DDDD:** Day as numerical day of year (e.g., 157 means the 30th of May) **Time tokens:** **• H HH:** Hours in 24-hour format, 0-23 (e.g., 17 refers to 5 PM) **• h hh:** Hours in 12-hour format, used with a A for AM or PM (e.g., 5 PM refers to 17:00) **• k kk:** Hours in 24-hour format, 1-24, with 24 being midnight **• a A:** Displays the AM/PM marker. For example, the 24‑hour time 19:45 would format as 07:45 PM when using a/A. **• m mm:** Minutes, 0-59 (e.g., 15 represents a quarter hour) **• s ss:** Seconds, 0-59 (e.g., 30 represents half a minute) **• S SS SSS:** Milliseconds, 0-999 (e.g., 250 represents a quarter second) **• Z ZZ:** UTC offset (e.g., +1:00 refers to GMT+1). When used, the previously defined timezone is ignored **• X:** Unix timestamp, without milliseconds or with milliseconds as a decimal. For example, 1547032502.250 refers to 2019-01-09 12:15:02 and 250 ms. **• x:** Unix timestamp with milliseconds. For example, 1547032502250 refers to 2019-01-09 12:15:02 and 250 ms. **Examples:** **• DD/MM/YYYY hh:mm:ss a** → 09/01/2025 10:15:02 PM **• MM/DD/YYYY HH:mm:ss.SSS** → 01/15/2025 10:30:10.150 **• MMM DD YYYY kk:mm:ss** → Feb 02 2025 24:05:00 **• DD/MM/YYYY HH:mm:ssZZ** → 20/02/2025 13:00:00-06:00 - **Timezone:**Select the timezone applied to the timestamps: - **UTC:** The timestamp uses the UTC timezone. - **Server**: The timestamp uses the timezone of the server where the notifier is running. - **Custom**: The timestamp uses the timezone selected in Custom timezone. - **Custom timezone:** When timezone is set to Custom, specify the desired timezone (e.g., Europe/London, America/New_York). |

### Triggers

Triggers define the conditions under which a message will be sent. There are **four types of triggers** available: **Alarm**, **Periodic**, **TagCondition**, and **TagChange** triggers. Multiple triggers can be configured for a single message, and the message will be sent when any of the configured triggers activate.

> [!WARNING]
> Note:
> 
> Starting with **N3uron version 1.22.0**, the **TagChange trigger** is available, allowing messages to be triggered based on value, quality, or timestamp

#### **Alarm Trigger**

The Alarm trigger sends a message when alarms matching specific criteria are activated. The following table describes the Alarm trigger configuration settings.

| Setting | Description |
| --- | --- |
| Path | Base tag path to monitor for alarms. Use **/** to monitor all alarms in the tag namespace, or specify a specific path such as **/Plant01/Area01** to limit monitoring to alarms within that branch. |
| Regex pattern | Regular expression filter for alarm paths. Only alarms whose full paths match this regex pattern will trigger the message. Use **.*** to match all alarms, or specific patterns like **.*TEMP.*** to match only alarms containing "TEMP" in their path. |
| Minimum priority | Minimum alarm priority level that will trigger the message. - **0 - Diagnostics:** Informational alarms for system status. - **1 - Low:** Minor issues requiring attention. - **2 - Medium:** Moderate issues warranting investigation. - **3 - High:** Significant problems requiring prompt attention. - **4 - Critical:** Severe issues demanding immediate action. |
| Active & Acked | Triggers when an alarm is active and has been acknowledged by an operator. |
| Active & Unacked | Triggers when an alarm becomes active and has not been acknowledged. |
| Cleared & Unacked | Triggers when an alarm condition is resolved but not yet acknowledged. |
| Cleared & Acked | Triggers when an alarm is fully resolved and acknowledged. |
| Notification delay | Time delay in milliseconds before sending the message after the alarm trigger condition is met. This prevents message flooding from rapidly changing alarm states. |

#### **Periodic Trigger**

The Periodic trigger sends messages at scheduled intervals or specific times. This is useful for periodic reports or status updates. The following table describes the Periodic trigger configuration settings.

| Setting | Description |
| --- | --- |
| Type | - **Fixed time:** The period starts counting when the module starts, and it increases the specified amount whenever the trigger is active. For example, if the period is 30000 ms, and the module starts at 12:32:12, the transaction executes on start, and every 30 seconds afterwards, for example, at 12:32:42. - **Fixed interval**: The trigger becomes active at fixed points in time, depending on the given period. For example, if the period is 5 minutes, the trigger is activated at xx:00 , xx:05, xx:10, etc. - **Cron:** The actions start periodically based on a [cron expression](https://crontab.guru/). If the script doesn't finish before the next scheduled time, that execution will be skipped. |
| Scan rate | Specifies the scan rate of the periodic trigger, in milliseconds. The minimum value is 1000 milliseconds. |
| Cron expression | When Type is set to **Cron**, this parameter accepts cron expression syntax to schedule specific execution times. Format: *** * * * *** representing minute, hour, day of month, month, and weekday. Example: **0 8 * * *** executes daily at 8:00 AM. |
| Reschedule timer | When enabled, the timer is rescheduled after the trigger is executed. **Example:** If a message with several triggers (including a 60-second periodic trigger, which executed at 11:30:10) is executed at 11:30:25. - Reschedule enabled: The periodic trigger is executed at 11:31:25, rescheduling the timer to execute 60 seconds after the current execution. - Reschedule disabled: The periodic trigger is executed at 11:31:10, which is 60 seconds after the previous periodic execution. |
| Run on start | When enabled, the message is sent immediately when the module starts. |

#### **TagCondition Trigger**

The TagCondition trigger sends a message when a tag value meets a specified condition, such as exceeding a threshold or matching a specific value. The following table describes the TagCondition trigger configuration settings.

| Setting | Description |
| --- | --- |
| Tag | Full path to the tag whose value will be monitored for the condition. **Example**: /Plant01/Area01/Temperature. |
| Property | Specifies the tag property used as a trigger, value, quality, or timestamp. |
| Initial change | Specifies if the initial subscription must also be considered as a valid trigger. For instance, after a reboot, the value of the tag acting as a trigger can change from <null> to true. If the initial change was enabled, then this change would activate the trigger. |
| Condition | Comparison operator to apply to the tag value. Available conditions: - **Equal to** - **Not equal to** - **Greater than** - **Greater than or equal to** - **Less than** - **Less than or equal to** - **Is null** - **Not null** |
| Value | The value used in the condition to compare to. It can be a number, a string or a boolean (true / false). |
| Delay | Specifies the delay, in milliseconds, the trigger condition must remain active before sending the notification. |
| Condition type | Specifies how the condition is evaluated: - **If true**: The action triggers when the condition becomes true. It can only trigger once or once per tag update, depending on the value of Trigger on update. - **If false**: The action triggers when the condition becomes false. Just like the case above, it can trigger only once or once per tag update, depending on the value of Trigger on update. - **While true**: The action triggers when the condition becomes true, and then keeps repeating periodically, according to the specified Period. - **While false**: The action triggers when the condition becomes false, and then keeps repeating periodically, according to the specified Period. |
| Trigger on update | When enabled, the action triggers every time a new tag update is received that still satisfies the condition. This option is only used when the condition type is either If true or If false. When disabled, it only triggers once when the condition becomes true. |
| Reset trigger | If enabled, the trigger is reset to the value provided in Reset value after the trigger has been activated. |
| Reset value | Specifies the value that will be written automatically to the tag after the notification has been completed. |

#### **TagChange Trigger**

The TagChange trigger, sends a message whenever the value of a specified tag changes. This is useful for monitoring critical process variables or state changes. The following table describes the TagChange trigger configuration settings.

| Setting | Description |
| --- | --- |
| Tag | Full path to the tag that will be monitored for value changes. Any change in the tag value will trigger the message. **Example**: /Plant01/Area01/Status. |
| Property | The property of the tag evaluated in the condition can be its value, quality, or timestamp. |
| Initial change | Specifies whether the script should trigger on the initial subscription or not. |

### Message Contents

The Message contents section defines the data included in notification messages. **N3uron** supports two types of message content tables: the **Alarms table** for alarm-related data and the **Tags table** for tag value information. Each message can include one or both table types, and each table type has its own filtering and column configuration options.

#### **Alarms table**

The Alarms table includes alarm information in the notification message. This table can be configured to filter specific alarms and display selected alarm properties. The following table describes the Alarms table configuration settings.

| Setting | Description |
| --- | --- |
| Title | Allows the inclusion of a title above the alarms table. This parameter is optional. |
| Include triggers | When enabled, the alarms triggering the notification are also included in the alarms table along with other alarms included by alarm filters. |
| Columns | - **Timestamp**: Specifies if the timestamp column must be included in the alarms table of the message. - **Path**: Specifies if the tag path column must be included in the alarms table of the message. - **Value**: Specifies if the value column must be included in the alarms table of the message. - **Description**: Specifies if the description column must be included in the alarms table of the message. - **Priority**: Specifies if the priority column must be included in the alarms table of the message. - **Status**: Specifies if the status column must be included in the alarms table of the message. - **Link**: Specifies if the link information column must be included in the alarms table of the message. - **Acked by**: Specifies if the acknowledgement details column must be included in the alarms table of the message. - **Ack comment**: Specifies if the acknowledgement comment column must be included in the alarms table of the message. |

#### **Alarm Filter**

Alarm filters control which alarms are included in or excluded from the notification message. Multiple filters can be configured to create complex filtering logic. The following table describes the Alarm Filter configuration settings.

| Setting | Description |
| --- | --- |
| Mode | Selects whether the filter must include or exclude tags from the result. Include filters are applied first, and then the exclude filters are applied to the result of the include filters. **• Include:**Alarms matching the filter are included in the result. **• Exclude:** Alarms matching the filter are excluded from the result. Multiple filters can be combined to create sophisticated filtering logic. |
| Path | Selects a specific tag or a tag group to apply the filter. |
| Regex pattern | Specifies a regular expression used to filter the tags. The default regular expression is .*, which means all the tags must be included in the result. More information about regular expressions can be found at [RegExr](https://regexr.com/). **Example**: If the RegEx pattern is ALARM\|WARNING, only tags containing ALARM or WARNING in their tag path are included in the result. |
| Minimum priority | Specifies the minimum priority of the alarms included in the filter. Alarms with lower priority are excluded from the result of the f.ilter |
| Active & Acked | Includes alarms that are currently active and have been acknowledged by an operator. |
| Active & Unacked | Includes alarms that are currently active but have not been acknowledged. |
| Cleared & Acked | Includes alarms that have been cleared and acknowledged. |
| Cleared & Unacked | Includes alarms that have been cleared but not yet acknowledged. |

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/AlarmTable.png)

### 

#### **Tags table**

The Tags table includes tag value information in the notification message. This table can display current values, quality, and timestamps for selected tags. The following table describes the Tags table configuration settings.

| Setting | Description |
| --- | --- |
| Title | Permits to include a title above the tags table. This parameter is optional. |
| Columns | - **Tag path:** Specifies if the tag path column must be included in the tags table of the message. - **Value**: Specifies whether the value column must be included in the tags table of the message. - **Quality**: Specifies whether the quality column must be included in the tags table of the message. - **Timestamp**: Specifies whether the timestamp column must be included in the tags table of the message. |

#### **Tags filter**

Tag filters control which tags are included in or excluded from the notification message. Multiple filters can be configured to create complex filtering logic. The following table describes the Tag Filter configuration settings.

| Setting | Description |
| --- | --- |
| Mode | Defines whether the current filter condition is used to Include or Exclude tags based on the associated regular expression pattern. Each filter consists of one or more Include and Exclude rules, each with its own regex pattern: - Include: Adds matching tags to the candidate list. - Exclude: Removes matching tags from the list of included tags. The filtering process first applies all Include conditions, and then applies any Exclude conditions to the resulting set. |
| Path | Selects a specific tag group to apply the filter |
| Regex pattern | Specifies a regular expression used to filter the tags. The default regular expression is .*, which means all the tags must be included in the result. More information about regular expressions can be found at [RegExr](https://regexr.com/). **Example**: If the Regex pattern is ALARM\|WARNING, only tags containing ALARM or WARNING in their tag path are included in the result. |

> [!WARNING]
> Note:
> 
> At least one Include condition must be defined for the filter to have any effect.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/TagTable.png)

## Notifiers

Notifiers define the delivery mechanism for messages. **N3uron** supports multiple notifier types, allowing messages to be sent through different channels.

The following notifier types are available:

- **Mail Notifier:** Sends notifications via email through SMTP servers.
- **SMPP Notifier:** Delivers SMS messages through the Short Message Peer-to-Peer protocol.
- **Webhook Notifier:** Sends notifications to popular communication platforms such as **WhatsApp**, **Slack**, **Discord**, **Telegram**, **Twilio**, as well as other third-party systems that support Webhook endpoints.

> [!WARNING]
> Note:
> 
> Starting with**N3uron version 1.22.0**, the **Webhook notifier**is available.

### Parameters

Notifiers with parameters can be used by accessing the $.parameter object. Each parameter corresponds to one or more tag events, and each tag event includes the following properties:

- **tag**: The path of the tag.
- **value:** The current value of the tag (number, string, boolean, or null).
- **quality:******The parameter [quality](https://docs.n3uron.com/docs/platform-tags-overview#quality-codes) is a number in the range of 0-255, which represents a level of confidence in the tag value.
- **ts (timestamp):******The parameter timestamp is a number that represents the number of milliseconds lapsed since January 1970 (Unix Epoch).

| Setting | Description |
| --- | --- |
| Single tag | This parameter will contain a single tag specified with a tag path. |
| Tag group | This parameter will contain a group of tags that are included in the specified path |
| Multiple tags (Filter) | This parameter will contain any of the tags that match the given filters. |

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/webhook07.png)

To access parameters declared in the Notifier, reference the $.parameter object followed by the parameter name.

**Single tag**

For a Single tag parameter, $.parameter.<name> is a single tag event object, so you can access its fields directly:

```javascript
$.parameter.PT_101.tag;
$.parameter.PT_101.value;
$.parameter.PT_101.quality:
$.parameter.PT_101.ts;
```

**Tag group / Multiple tags (Filter)**

For a **Tag group** or **Multiple tags (Filter)** parameter, $.parameter.<name> **returns**an **array**of tag event objects. Iterate over the array to access each tag’s fields (**tag**, **value**, **quality**, **ts**):

```javascript
for (const ev of $.parameter.A0_L1) {
  // ev.tag, ev.value, ev.quality, ev.ts
}
```

Since $.parameter is a JavaScript object, it can be iterated to programmatically obtain all parameters using the for…of syntax. An iteration example can be seen in the following snippet:

```javascript
for (const [param, value] of Object.entries($.parameter)){
   $.logger.info("Parameter %s is %j", param, value);
}
```

**Extract Tag Objects as a Flat Array from Parameters:**

This sample function demonstrates how to extract and flatten all values from Parameters into a single array. It supports both cases where a parameter value is an array of tag objects (each element will be added individually) or a single tag object (added directly). The result is a flat array of parameter values, which can then be used for further processing.

```javascript
function getValuesFromParameters() {
  const parameterValues = [];
  for (const paramValue of Object.values($.parameter)) {
    if (Array.isArray(paramValue)) {
      // Parameter is an array: append each element individually
      for (const element of paramValue) {
        parameterValues.push(element);
      }
    } else {
      // Parameter is a single tag object: append it directly
      parameterValues.push(paramValue);
    }
  }
  return parameterValues;
}
```

### Mail Notifier

The **Mail Notifier** sends messages via email using an **SMTP server**. The following table describes the Mail Notifier configuration settings.

| Setting | Description |
| --- | --- |
| Enabled | Enables message notifications through this notifier |
| Connection | - **SMTP server**: Hostname or IP address of the SMTP mail server. Example: **smtp.gmail.com** or **192.168.1.100**. - **SMTP port**: Specifies the port used by the SMTP server. Valid range is 1 to 65535. The default value is 587. - **Authentication**: Selects the type of authentication used to connect to the SMTP server. Available options: None or User/Password. - **TLS**: - **Enabled**: Enables the use of TLS (Transport Layer Security) encryption to connect to the host. - **CA certificate**: Allows importing the CA certificate used by the SMTP server. - **Reject unauthorized**: This setting controls the connection behavior when it receives an invalid or untrusted certificate from the SMTP server during a TLS (Transport Layer Security) connection. If it is enabled, it will terminate the connection if the SMTP server's certificate cannot be verified as valid and trusted. This means the certificate must: If it is disabled, it will proceed with the connection even if there are problems with the SMTP server's certificate. This can be helpful for testing or troubleshooting in controlled environments, but should be avoided in production environments. - Be issued by the same Certificate Authority (CA) of the imported certificate. - Not expired. - Match the hostname/domain of the SMTP server. |
| Message configuration | - **Message configuration type**: - **Text**: The email fields are given as fixed text. - **Custom**: The email format and fields are provided through a JavaScript expression, especially suited for more dynamic email message configuration. Examples are shown below. - **From**: Permits to specify the user sending the message. This parameter is optional. - **To**: Specifies the email address of the recipient. This entry admits one recipient. To include more recipients, **CC**and **BCC**may be used. - **CC**: Specifies the recipients included as CC. Several comma-separated email addresses can be included. This parameter is optional. - **BCC**: Specifies the recipients included as BCC. Several comma-separated email addresses can be included. This parameter is optional. - **Subject**: Specifies the subject of the email. - **Body**: Specifies the text included in the body of the message. If the message includes alarm and/or tag tables, the body is located above the tables. |
| Attachments | - **Enabled:**Permits attaching files to the email. - **Folder path**: Path to the folder containing the files to be attached to the email. It can be absolute or relative to <installation folder>/Data/Notifier/ in Linux systems and <installation folder>\Data\Notifier\ in Windows systems. Relative paths should not start with / in Linux systems or \ in Windows systems to avoid confusion with absolute paths. - **RegEx pattern**: Specifies a regular expression used to filter the files. The default regular expression is .*, which means all the files are included in the filter. More information about regular expressions can be found at [RegExr](https://regexr.com/). **Example**: If the RegEx pattern is .*\.csv, only files with the .csv extension are attached. |

**Example using a Template**

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/mail01(2).png)

#### **Custom message configuration**

Applies when **the Message configuration type** is set to **Custom**. Provide a JavaScript script to dynamically set the email fields for each notification.

The script has access to the following functions and objects:

- **Buffer**: Class used to manipulate a byte buffer directly. More information can be found at: [NodeJS API Reference](https://nodejs.org/docs/v0.12.7/api/buffer.html).
- **moment**: Class used to parse, format, and manipulate dates. This has access to both normal moment and moment-timezone. More information can be found at: [moment](https://momentjs.com/docs/)and [moment-timezone](https://momentjs.com/timezone/docs/).
- **sprintf**: Function used to simplify formatting a string using placeholders and a list of arguments, using the same format as the C sprintf function. More information can be found at [C++ reference - sprintf](https://cplusplus.com/reference/cstdio/sprintf/).
- **$.logger**: Object containing logging functions that can be used to log custom messages during script execution. Valid log levels are **error**, **warn**, **info**, **debug**, and **trace**. Each of these functions can be used as **$.logger.info(message, args...)**. The logger accepts a format string in the [sprintf](https://cplusplus.com/reference/cstdio/sprintf/)format.
- **$.local**: This object can be used to keep user-defined data between multiple executions of the same notifier. By default, it's an empty object. For example, a property named **scanCount**can be defined by using **if(!$.local.scanCount) $.local.scanCount = 0**. These properties can be accessed from any scripts executed by a notifier.
- **$.parameters**: Object containing all declared parameters for this notifier. Each parameter can be accessed by using its instance name. For example, if a parameter is named **startTime**, it can be accessed using **$.parameter.startTime**. Each parameter has a value, quality, and timestamp (in UNIX epoch format, with milliseconds). Using the previous example, to access the value **$.parameter.startTime.value** is used; the quality requires using **$.parameter.startTime.quality**, and the timestamp uses **$.parameter.startTime.ts**.
- **$.output**: The script must set in $.output an object with the desired email content. The object can have the following properties: **from**, **to**, **cc**, **bcc**, **subject**, and **body**. **Example — custom subject and body**:

```javascript
$.output = {
  from: "from@email.com",
  to: "to@email.com",
  subject: "Custom subject",
  body: "This is the custom body"
};
```

You can also access parameters to build the email content dynamically. **Example — build content from $.parameters**

```javascript
const device = $.parameters.deviceName
  ? $.parameters.deviceName.value
  : "Unknown device";

$.output = {
  from: "from@email.com",
  to: "to@email.com",
  subject: sprintf("Alert from device %s", device),
  body: sprintf("The device %s has triggered an alert.", device)
};
```

Whenever you open the JavaScript editor, a default template is provided, well-commented and structured to help you get started.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/mail02.png)

### SMPP Notifier

The **SMPP**(Short Message Peer-to-Peer) Notifier sends SMS text messages through an **SMPP server**. The following table describes the SMPP Notifier configuration settings.

| Setting | Description |
| --- | --- |
| Enabled | This parameter specifies the hostname, IP or URL of the SMPP server. |
| Connection | - **Host**: This parameter specifies the hostname, IP or URL of the SMPP server. - **Port**: This parameter specifies the port used by the SMPP server. Valid range is 1 to 65535. The default setting is 2775. - **System ID**: System ID to be used in the SMPP connection. Specifies the username or system ID for the SMPP server authentication. This parameter is optional; in order to connect without authentication, both username and password must be empty. - **Password**: Specifies the password for the SMPP server authentication. This parameter is optional; in order to connect without authentication, both username and password must be empty. - **Request timeout**: The maximum amount of time to wait for a valid response from the SMPP server indicating the success or failure of the request, in milliseconds. The notification is retried up to 3 times, and if a successful response is not received during any of these attempts, the notification is considered unsuccessful. Default value is 10000ms. |
| Security | **Encryption**: - None: The connection is not encrypted. - TLS: The connection is encrypted using TLS. |
| Message configuration | - **Message configuration type**: - **Text**: The SMPP fields are given as fixed text. - **Custom**: The email format and fields are provided through a JavaScript expression, especially suited for more dynamic email message configuration. Examples are shown below. - **Recipients**: Specifies the cell phone number of the recipients. Several recipients can be included using a comma-separated list. The phone numbers must include the country's prefix, using + or filling with zeros to reach 4-character length. For instance, the cell number +1 (987) 654-3210 can be expressed as +19876543210 or 00019876543210. - **Body**: Allows to include text displayed above the Alarms and Tags tables. This parameter is optional. |

#### **Custom message configuration**

The same approach applies as described in the **Mail Notifier** custom message configuration (see section above). The key difference is the **output structure**: for the **SMPP notifier**, the script must produce an **SMS**payload instead of email fields.

**$.output** The script must set **$.output** to an object containing the desired **SMS**configuration. The object must include the following properties: **recipients** and **body**.

**Example — static recipients and body**

```javascript
$.output = {
  recipients: "+19876543210,+12345678901",
  body: "This is a test message"
};
```

The script can access parameters to configure the SMS payload dynamically.

**Example — build recipients and body from parameters**

```javascript
$.output = {
  recipients: $.parameters.recipients.value,
  body: sprintf(
    "Alert triggered at %s",
    moment().format("YYYY-MM-DD HH:mm:ss")
  )
};
```

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/mail03.png)

> [!WARNING]
> Note:
> 
> Starting with **N3uron version 1.22.0**, you can create **custom messages** using **JavaScript expressions** and use **parameters**.

### Webhook Notifiers

Webhook notifiers enable **N3uron** to send alarm and tag notifications to external services and messaging platforms via HTTP/HTTPS requests. The Notifier module supports multiple Webhook types including **Discord**, **Slack**, **Twilio**, **WhatsApp**, **Telegram**, and **customizable Webhooks**. Built-in webhooks offer platform-specific configurations while sharing common settings for headers, delivery options, and message formatting.

The following Webhook notifier types are available:

| Type | Description |
| --- | --- |
| Discord | Sends notifications to Discord channels using Discord Webhook URL. Provided user name, message templates, and channel/service configuration. |
| Slack | Sends notifications to Slack channels using Slack Webhook URL. Provides options for user name, message templates, and channel/service configuration. |
| Twilio | Sends messages via the Twilio API. Requires Twilio account credentials (Account SID and Auth Token) and phone number configuration. |
| WhatsApp | Sends notifications to WhatsApp using the WhatsApp Business Platform (Cloud API). Requires an Authorization Token and Phone Number ID configuration. |
| Telegram | Sends notifications to Telegram chats using the Telegram Bot API. Requires a Bot Token and Chat ID for message delivery. |
| Custom | Provides complete control over Webhook configuration including custom URL, headers, body format, serialization, and JavaScript-based request body generation. Use this type for integration with APIs not explicitly supported by other notifier types. |

#### **Discord Configuration**

| Setting | Description |
| --- | --- |
| Enabled | Enables message notifications through this notifier. |
| Notifier type | Discord |
| Webhook URL | Specifies the endpoint URL where notifications will be sent. |
| User Name | User name to identify the webhook message. |
| Message template | Specifies the text included in the message. If the message includes alarm and/or tag tables, the body is located above them. |
| Channel/Service | Channel or service identifier (if applicable). |

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/webhook02(1).png)

[Configure Discord Webhook](https://discord.com/developers/docs/resources/webhook)

#### **Slack Configuration**

| Setting | Description |
| --- | --- |
| Enabled | Enables message notifications through this notifier. |
| Notifier type | Slack |
| User Name | User name to identify the webhook message. |
| Message template | Specifies the text included in the message. If the message includes alarm and/or tag tables, the body is located above them. |
| Channel/Service | Channel or service identifier (if applicable). |

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/webhook03.png)

[Configure Slack Webhook](https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks/)

#### **Twilio Configuration**

| Setting | Description |
| --- | --- |
| Enabled | Enables message notifications through this notifier. |
| Notifier type | Twilio |
| Account SID | Twilio Account SID. |
| Auth Token | Specifies the token used for authentication. |
| From | Sender identifier (if applicable). |
| To | Recipient identifier (if applicable). |

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/webhook04.png)

[Configure Twilio Webhook](https://www.twilio.com/docs/usage/webhooks/messaging-webhooks)

#### **Telegram Configuration**

| Setting | Description |
| --- | --- |
| Enabled | Enables message notifications through this notifier. |
| Notifier type | Telegram |
| Phone Number ID | Telegram phone number identifier associated with the bot. |
| Chat ID | Telegram Chat ID. |
| Bot Token | Telegram Bot Token. |

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/webhook05.png)

[Configure Telegram Webhook](https://core.telegram.org/bots)

#### **WhatsApp Configuration**

| Setting | Description |
| --- | --- |
| Enabled | Enables message notifications through this notifier. |
| Notifier type | WhatsApp |
| Auth Token | Specifies the token used for authentication. |
| Phone Number ID | WhatsApp Phone Number ID. |
| To | Recipient identifier (if applicable). |

[Configure WhatsApp Webhook](https://business.whatsapp.com/blog/how-to-use-webhooks-from-whatsapp-business-api/)

#### **Custom Webhook Configuration**

| Setting | Description |
| --- | --- |
| Enabled | Enables message notifications through this notifier. |
| Notifier type | Custom |
| Webhook URL | Specifies the endpoint URL where notifications will be sent. |
| Body Format | **Serialization**: Selects the serialization of the body of the request data - **Text**: The body data must be a string, and then this string will be sent as the body of the request. - **JSON**: The body data must be a JavaScript object, which will then be converted to a JSON string. **Encoding**: Selects which format is used to encode the body. - **UTF8**: Encodes the body as a UTF8 string. - **Binary**: Encodes the body as a binary buffer. - **Base64**: Encodes the body as a Base64 encoded string. - **Hex**: Encodes the body as a hexadecimal string. |
| Body serializer | **Type** - **Custom**: Utilizes a user-defined script to generate the body of the request. **Options** - **Script**: Script that will be used to generate the body of the request. The result of this script will then be serialized using the specified serializer. |

**Custom Webhook Body Serializer**

Script that will be used to generate the body of the request. The result of this script will then be serialized using the specified serializer. The parsing script has access to the following functions and objects:

- **Buffer**: Class used to manipulate a byte buffer directly. More information can be found at: [NodeJS API Reference](https://nodejs.org/docs/v0.12.7/api/buffer.html).
- **moment**: Class used to parse, format, and manipulate dates. This has access to both normal moment and moment-timezone. More information can be found at: [moment](https://momentjs.com/docs/) and [moment-timezone](https://momentjs.com/timezone/docs/).
- **sprintf**: Function used to simplify formatting a string using placeholders and a list of arguments, using the same format as the C sprintf function. More information can be found at [C++ reference - sprintf](https://cplusplus.com/reference/cstdio/sprintf/).
- **$.logger**: Object containing logging functions that can be used to log custom messages during script execution. Valid log levels are **error**, **warn**, **info**, **debug**, and **trace**. Each of these functions can be used as $.logger.info(message, args...). The logger accepts a format string in the [sprintf](https://cplusplus.com/reference/cstdio/sprintf/) format.
- **$.local**: This object can be used to keep user-defined data between multiple executions of the same notifier. By default, it's an empty object. For example, a property named scanCount can be defined by using if(!$.local.scanCount) $.local.scanCount = 0. These properties can be accessed from any scripts executed by a notifier.
- **$.parameters**: Object containing all declared parameters for this notifier. Each parameter can be accessed by using its instance name. For example, if a parameter is named startTime, it can be accessed using $.parameters.startTime. Each parameter has a value, quality, and timestamp (in UNIX epoch format, with milliseconds). Using the previous example, to access the value $.parameters.startTime.value is used; the quality requires using $.parameters.startTime.quality, and the timestamp uses $.parameters.startTime.ts.
- **$.output**: The script must set this value to the desired output. The type of the output depends on the selected serializer; if the serializer is JSON, the output must be an object, and if it's text, it must be a string.

**Example:**

```javascript
// Log initial execution info 
$.logger.info("Notifier script started at %s", moment().format("YYYY-MM-DD HH:mm:ss"));

// Initialize or increment a local counter that persists between executions
if (!$.local.sendCount) $.local.sendCount = 0;
$.local.sendCount++; 

// Access parameters safely and log their values
if ($.parameters.startTime) {
  $.logger.debug("Start time parameter: %s", moment($.parameters.startTime.value).toISOString());
}
if ($.parameters.deviceName) {
  $.logger.debug("Device name: %s", $.parameters.deviceName.value);
}

// Example of conditional logic based on parameter values
const device = $.parameters.deviceName ? $.parameters.deviceName.value : "Unknown device";
const start = $.parameters.startTime ? moment($.parameters.startTime.value).format("HH:mm:ss") : "N/A";

// Example of building a message body dynamically
const message = sprintf(
  "Device '%s' triggered a notification at %s. This is execution #%d.",
  device,
  start,
  $.local.sendCount
);

// Log the final message
$.logger.info("Final message: %s", message);

// Example of using $.input to include embed data, if present
const embeds = Array.isArray($.input) ? $.input : [];

// Set the script output
$.output = {
  username: "N3uron Script Engine",
  content: message,
  embeds,
};
```

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/webhook06.png)

#### **Common Headers Settings**

| Setting | Description |
| --- | --- |
| Fixed headers | - **Accept-Encoding**: - **GZip**: Sets the Accept-Encoding header to GZip, which indicates to the server that the client can accept GZip-compressed payloads. This is the recommended value. - **Deflate**: Sets the Accept-Encoding header to Deflate, which indicates to the server that the client can accept Deflate-compressed payloads. - **None**: Sets the Accept-Encoding header to *, which indicates to the server that the client can only accept uncompressed payloads. - **Content-Type:** Sets the Content-Type header of the request, which indicates the media type of the resource being sent to the server. - **application/json** - **application/x-www-form-urlencoded** - **text/plain** - **text/html** |
| Authorization | **Type**: Selects the type of authentication used with this webhook. - **None**: No Authorization header will be set for the webhook. - **Basic**: Uses basic HTTP authentication to authenticate with the server. - **Bearer**: Uses a bearer token to authenticate with the server. |
| Custom headers | **Type**: Selects how the value for this header is created. - **Raw**: The value of the header is set to a static text value. - **Custom**: The value of the header is obtained by running a user-defined script before each message. |

#### **Common Chat Options**

| Setting | Description |
| --- | --- |
| Message Separator | Defines the text or symbol used to visually separate each message block (e.g., alarms or tag entries) within the output. Common examples include '---', '***' or '####'. |

#### **Common Delivery Settings**

| Setting | Description |
| --- | --- |
| Timeout (ms) | Maximum request time before aborting. |
| Retries | Number of retry attempts on transient errors. |
| Transmission Delay | Specify the delay between sequential messages, in milliseconds. Higher delay means more time to execute all requests, but it can help avoid rate-limiting issues. |

[Notifier Full Product Details](https://n3uron.com/iiot-platform-modules/notifier/)
