# Notification Templates

When a rule's condition matches, then a notification is created and possibly sent to the customer. A notification consists of a message title, a message text, and actions (primary & secondary). It needs to be defined for all languages, which have been enabled for your company.\
Additionally a notification may also contain a command, which contains an instruction for a machine-to-machine interface.\ <br>

<figure><img src="/files/R2oRM2T6BJFxLQWbpqWS" alt=""><figcaption></figcaption></figure>

## Multiple Notification Cases

In case the *Multiple Notification Cases* toggle is active, you are able to specify a set of notification templates.&#x20;

![](/files/8Wbu7dCOFF6x63gDDWCK)

<figure><img src="/files/sbYxxgRhNfRAqoaGwyIC" alt=""><figcaption></figcaption></figure>

Each template has an additional "*Label*" field, which describes what this case is about, and an additional "*Case Condition*" field, which is used to decide which notification case is to be chosen. \
This is done by going through the cases list from the top until the first case condition matches. If no case condition matches, then no notification template is selected (i.e. no notification would be sent).

<figure><img src="/files/R7Ya8z4JFHD8KKefh5cp" alt=""><figcaption></figcaption></figure>

Hint: in case you want to specifiy a "default" case, add this case to the bottom of the list, and set "*Case Condition*" value to "true".

## Message

### Message Title

This field contains the content for the message title.

### Message Text

This field contains the content for the message text, and may contain dynamic data, so that e.g. the effective grid power consumption of the last week may be embedded into the message, with a suitable formatting.

IMPORTANT: this field does not expect a static text, like in the message title, but same syntax as expected in the [Condition](/platform-manual/rules/rule-configurator/condition.md) field.  I.e. it has to be expressed as a mathematical expression which produces a *text*. It consists of:

* dataset references\
  E.g. `$MyConsumption` refers to the dataset with name *MyConsumption*
* values \
  E.g. text `"Excpected consumption is..."` (text can be wrapped in single or double quotes)&#x20;
* operators \
  E.g. plus operator `+` (for text concatination, or number addition), or format operator `|` to format numbers, etc
* functions \
  E.g. average function `MAX(...)`, which finds the maximum value of specified time series

Have a look at [Rule Language](https://app.gitbook.com/o/mHVsgmp8VieATykD486b/s/kz3AVy8mukfhOsBy0Lvo/~/changes/94/platform-manual/rules/rule-configurator/moost-rule-language) to see the full feature set of the expression language.

### Primary and Secondary Action Text

This field contains the text which should be displayed for the primary and secondary action.

### Primary and Secondary Action

This field defines the action category of the primary and secondary action.

## Command

Optionally, you may specify a command containing an instruction for a machine-to-machine interface so that some actions could be triggered. The command is expected to be a [Rule Language](https://app.gitbook.com/o/mHVsgmp8VieATykD486b/s/kz3AVy8mukfhOsBy0Lvo/~/changes/94/platform-manual/rules/rule-configurator/moost-rule-language) expression.

When a rule's condition matches, then the notification will not only contain a message but the evaluated expression.

**Example**

<figure><img src="https://doc.moost.io/~gitbook/image?url=https%3A%2F%2F2791588365-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fkz3AVy8mukfhOsBy0Lvo%252Fuploads%252FgGZdp7bZ2PurusMjeid7%252Fimage.png%3Falt%3Dmedia%26token%3Dd2d7e38a-3c90-4ef8-86b8-c1adc9109b67&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=cef72d7f&#x26;sv=2" alt=""><figcaption></figcaption></figure>

Have a look at [Rule Language](https://app.gitbook.com/o/mHVsgmp8VieATykD486b/s/kz3AVy8mukfhOsBy0Lvo/~/changes/94/platform-manual/rules/rule-configurator/moost-rule-language) to see the full feature set of the expression language.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.moost.io/platform-manual/rules/rule-configurator/message.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
