Alarm Notification Template

What is an Alert Notification Template?

In the ChainBot platform, an alert notification template is essentially a string with no length limit. Whenever a user creates a Bot, a default alert notification template is generated. Users need to modify the keywords in the alert notification template according to their own needs and can also change the injected variables based on the type of Bot monitoring.

Here is an example of an alert notification template:

[ {$subscription.name} ]
  Contract: {$event.contract}
  Time: {$block.time}
  Explore: {$chain.explore}/tx/{$tx.hash}
  Created By ChainBot.io

For instance, "Contract" is a keyword for ease of reading by the user, while "{$event.contract}" is a template variable. Template variables must be enclosed with "{}".

Learn about different Bot monitoring supported injection variables?

Advanced Features of Alert Notification Templates

To use this section, users need basic programming skills.

1. Formatting Time

// Format timezone to the user's set timezone
timezone($block.time, 8)

2. Arithmetic Operations

"123000000000000000000" / 1e18 == 123
"1" + "1" + 1 == 3
2 - 1 == 1
2 * 2 == 4

3. Rounding Operations

{ round(1000000000001000000 / 1e18, 1)}

Complex Alert Template Example

[{$subscription.name}]
Block: {$block.number}
Values: {$values._reserve0 / 1e18} / {$values._reserve1 / 1e18} = {$values.percent}
Condition: {$condition}
Time: {$block.time}

Last updated