The ITL enables you to customize and design alerts tailored to your specific use cases. In addition to offering flexibility in formatting and structuring alerts, it also provides a variety of built-in functions to further enhance the alerts' readablility.
In the UI's text mode, you may use the Insert data... dropdown to help you add template variables quickly - the text syntax works like this:
Type | Sample | Description |
---|---|---|
Text | Some text | You may, of course, add generic text content to your liking. |
Variable | {{ var }} | Extract content of the event and insert it. Note: there is no further sanitizing of the values. |
Accessing nested variables | {{ var . subfield . evenMore }} | Access sub fields |
Accessing fields of an array | {{ var.arrayField [0] .more }} | Access array contents |
Applying functions to variables | {{var.lowerCase () }} | See Functions below, for a list of all functions. |
Passing arguments to functions | {{var.splitTakeAt( "one two", 10 )}} | |
Sections (if/else blocks) |
| See Sections below. |
Loops (for blocks) |
| See Loops below. |
{% hint style="info" %} Note that when rendering variables their content is not (HTML) escaped. {% endhint %}
ITL allows you to apply functions for different use cases, such as string manipulation, date-time formatting, joining arrays. This flexibility makes it simple to handle text formatting, data extraction, and transformations, all within the same template.
Function | Description | Parameters |
---|---|---|
substring | Displays characters from the given start index(1) to the specified end index(2). (It is required to provide at least one parameter.) | substring(Integer(1)) substring(Integer(1), Integer(2)) |
lowerCase | Displays characters in lower case. | |
upperCase | Displays characters in upper case. | |
replaceAll | Replaces each of a given character sequence(1) with a new sequence(2). | replaceAll(String(1), String(2)) |
splitTakeAt | Divides a string into an array of substrings based on a character sequence as the delimiter. | splitTakeAt(String(1), Integer(2)) |
startsWithTake | Matches a given character sequence(1) with the start of a variable's value and replaces it with a different character sequence(2) if it matches. | startsWithTake(String(1), String(2)) |
equalsTake | Matches a given character sequence(1) with a variable's value and replaces it with a different character sequence(2) if it matches. | equalsTake(String(1), String(2)) |
endsWithTake | Matches a given character sequence(1) with the end of a variable's value and replaces it with a different character sequence(2) if it matches. | endsWithTake(String(1), String(2)) |
containsTake | Replaces a variable's value with a character sequence(2) if it contains a given character sequence(1). | containsTake(String(1), String(2)) |
startsWithTakeOrDrop | Matches a given character sequence(1) with the start of a variable's value and replaces it with a different character sequence(2) if it matches; otherwise, it does not display anything. | startsWithTakeOrDrop(String(1), String(2)) |
equalsTakeOrDrop | Matches a given character sequence(1) with a variable's value and replaces it with a different character sequence(2) if it matches; otherwise, it does not display anything. | equalsWithTakeOrDrop(String(1), String(2)) |
endsWithTakeOrDrop | Matches a given character sequence(1) with the end of a variable's value and replaces it with a different character sequence(2) if it matches; otherwise, it does not display anything. | endsWithTakeOrDrop(String(1), String(2)) |
containsTakeOrDrop | Replaces a variable's value with a character sequence(2) if it contains a given character sequence(1); otherwise, it does not display anything. | containsTakeOrDrop(String(1), String(2)) |
startsWithElse | Matches a given character sequence(1) with the start of a variable's value and replaces it with a different character sequence(2) if it doesn't match. | startsWithElse(String(1), String(2)) |
equalsElse | Matches a given character sequence(1) with the variable's value and replaces it with a different character sequence(2) if it doesn't match. | equalsElse(String(1), String(2)) |
endsWithElse | Matches a given character sequence(1) with the end of a variable's value and replaces it with a different character sequence(2) if it doesn't match. | endsWithElse(String(1), String(2)) |
containsElse | Replaces a variable's value with a character sequence(2) if it doesn't contain a given character sequence(1). | containsElse(String(1), String(2)) |
startsWithElseOrDrop | Matches a given character sequence(1) with the start of a variable's value and replaces it with a different character sequence(2) if it doesn't match; otherwise, it does not display anything. | startsWithElseOrDrop(String(1), String(2)) |
equalsElseOrDrop | Matches a given character sequence(1) with the variable's value and replaces it with a different character sequence(2) if it doesn't match; otherwise, it does not display anything. | equalsElseOrDrop(String(1), String(2)) |
endsWithElseOrDrop | Matches a given character sequence(1) with the end of a variable's value and replaces it with a different character sequence(2) if it doesn't match; otherwise, it does not display anything. | endsWithElseOrDrop(String(1), String(2)) |
containsElseOrDrop | Matches a given character sequence(1) with a variable's value and replaces it with a different character sequence(2) if it doesn't match; otherwise, it does not display anything. | containsElseOrDrop(String(1), String(2)) |
formatUnixMs | Formats a variable's value from milliseconds into ISO-8601 date-time format. Additionally, it accepts a format style character (1) as a parameter.
Any other character will lead to medium text style as default. | formatUnixMs() formatUnixMs(String(1)) |
formatUnixSec | Formats a variable's value from seconds into ISO-8601 date-time format. Additionally, it accepts a format style character (1) as a parameter.
Any other character will lead to medium text style as default. | formatUnixSec() formatUnixSec(String(1)) |
formatDateString | Formats a variable's value into ISO-8601 date format. Additionally, it accepts a format style character (1) as a parameter.
Any other character will lead to medium text style as default. | formatDateString() formatDateString(String(1)) |
join | Displays a text composed of array values joined by a given delimiter(1). If no delimiter is provided, the function defaults to ", " . | join() join(String(1)) |
joinFromObjectArray | Displays a text composed of object array(1) values joined by a given delimiter(2). If no delimiter is provided, the function defaults to a new line. | joinFromObjectArr(String(1)) joinFromObjectArr(String(1), String(2)) |
Function | Sample | Input data | Output |
---|---|---|---|
substring | {{ var.substring(3) }} {{ var.substring(5, 7) }} |
| result res |
lowerCase | {{ var.lowerCase() }} |
| gavin belson from hooli |
upperCase | {{ var.upperCase() }} |
| GAVIN BELSON FROM HOOLI |
replaceAll | {{ var.replaceAll("Gavin Belson", "Richard Hendricks") }} |
| Richard Hendricks owns Hooli |
splitTakeAt | {{ var.splitTakeAt("Belson, ", 1) }} |
| Richard Hendricks and Russ Hanneman are in the tres commas club |
startsWithTake | {{ var.startsWithTake("I am the best", "In your dreams - Bertram Gilfoyle") }} |
| In your dreams - Bertram Gilfoyle |
equalsTake | {{ var.equalsTake("I am better than Gilfoyle - Dinesh Chugtai", "Not true - Bertram Gilfoyle") }} |
| Not true - Bertram Gilfoyle |
endsWithTake | {{ var.endsWithTake("Dinesh Chugtai", "Flys - Bertram Gilfoyle") }} |
| Flys - Bertram Gilfoyle |
containsTake | {{ var.containsTake("rocks", "Pied Piper rocks") }} |
| Pied Piper rocks |
startsWithTakeOrDrop | {{ var.startsWithTakeOrDrop("I am the best", "In your dreams - Bertram Gilfoyle") }} | 1:
| 1: In your dreams - Bertram Gilfoyle 2: |
equalsTakeOrDrop | {{ var.equalsTakeOrDrop("I am better than Gilfoyle - Dinesh Chugtai", "Not true - Bertram Gilfoyle") }} | 1:
| 1: Not true - Bertram Gilfoyle 2: |
endsWithTakeOrDrop | {{ var.endsWithTakeOrDrop("Dinesh Chugtai", "Flys - Bertram Gilfoyle") }} | 1:
| 1: Flys - Bertram Gilfoyle 2: |
containsTakeOrDrop | {{ var.containsTakeOrDrop("rocks", "Pied Piper rocks") }} | 1:
| 1: Pied Piper rocks 2: |
startsWithElse | {{ var.startsWithElse("I am the best", "In your dreams - Bertram Gilfoyle") }} | 1.
| 1: I am the best software engineer at Pied Piper - Dinesh Chugtai 2: In your dreams - Bertram Gilfoyle |
equalsElse | {{ var.equalsElse("I am better than Gilfoyle - Dinesh Chugtai", "Not true - Bertram Gilfoyle") }} | 1:
| 1: I am better than Gilfoyle - Dinesh Chugtai 2: Not true - Bertram Gilfoyle |
endsWithElse | {{ var.endsWithElse("Dinesh Chugtai", "Flys - Bertram Gilfoyle") }} | 1:
| 1: I am the fastest coder - Dinesh Chugtai 2: Flys - Bertram Gilfoyle |
containsElse | {{ var.containsElse("rocks", "Pied Piper rocks") }} | 1:
| 1: Hooli rocks 2: Pied Piper rocks |
startsWithElseOrDrop | {{ var.startsWithElseOrDrop("I am the best", "In your dreams - Bertram Gilfoyle") }} | 1.
| 1: 2: In your dreams - Bertram Gilfoyle |
equalsElseOrDrop | {{ var.equalsElseOrDrop("I am better than Gilfoyle - Dinesh Chugtai", "Not true - Bertram Gilfoyle") }} | 1:
| 1: 2: Not true - Bertram Gilfoyle |
endsWithElseOrDrop | {{ var.endsWithElseOrDrop("Dinesh Chugtai", "Flys - Bertram Gilfoyle") }} | 1:
| 1: 2: Flys - Bertram Gilfoyle |
containsElseOrDrop | {{ var.containsElseOrDrop("rocks", "Pied Piper rocks") }} | 1:
| 1: 2: Pied Piper rocks |
formatUnixMs | {{ var.formatUnixMs() }} {{ var.formatUnixMs("S") }} |
| 1: Jan 29, 2023, 12:05:37 AM 2: 1/29/23, 12:05 AM |
formatUnixSec | {{ var.formatUnixSec() }} {{ var.formatUnixSec("S") }} |
| 1: Jan 29, 2023, 12:05:37 AM 2: 1/29/23, 12:05 AM |
formatDateString | {{ var.formatDateString() }} {{ var.formatDateString("S") }} |
| 1: May 25, 2021, 9:24:56 PM 2: 5/25/21, 9:24 PM |
join | {{ var.join() }} {{ var.join("- ") }} |
| 1: PiedPiper, Hooli, "Aviato" 2: PiedPiper- Hooli- Aviato |
joinFromObjectArray | {{ companies.joinFromObjectArr("name") }} {{ companies.joinFromObjectArr("ceo", "+") }} |
| 1: PiedPiper Hooli NewPiedPiper Raviga 2: PiedPiper+Hooli+NewPiedPiper+Raviga |
The ITL also supports block based sections and loops, providing flexibility in handling complex templates and varying data sets efficiently.
Sections allow for conditional rendering, where specific content is displayed only if a certain value exists or meets a given condition. Positive conditions check if a value is present or true
, while inverted conditions render content when the value is false
or missing.
A section begins with a hash #
and ends with a slash /
.
{% tabs %} {% tab title="True condition" %}
{{ #isTrue }}
Hello
{{ /isTrue }}
World!
{% endtab %}
{% tab title="False condition" %}
{{ #isFalse }}
Hello
{{ /isFalse }}
World!
{% endtab %} {% endtabs %}
Using the following context:
{
"isTrue": true,
"isFalse": false
}
{% tabs %} {% tab title="True condition output" %}
Hello World!
{% endtab %}
{% tab title="False condition" %}
World!
{% endtab %} {% endtabs %}
Inverted sections only render content based on the inverse value of a context key.
An inverted section begins with a caret ^
and ends with a slash /
. Example:
{% tabs %} {% tab title="True condition" %}
Hello
{{ #isTrue }}
World!
{{ /isTrue }}
{{ ^isTrue }}
Tim!
{{ /isTrue }}
{% endtab %}
{% tab title="False condition" %}
Hello
{{ #isFalse }}
World!
{{ /isFalse }}
{{ ^isFalse }}
Tim!
{{ /isFalse }}
{% endtab %} {% endtabs %}
Using the following context:
{
"isTrue": true,
"isFalse": false
}
{% tabs %} {% tab title="True condition output" %}
Hello World!
{% endtab %}
{% tab title="False condition output" %}
Hello Tim!
{% endtab %} {% endtabs %}
Loops allow to iterate over each item of a list or array of data and display render them as text.
{% hint style="info" %} ITL functions are only applicable to absolute variable keys, therefore they cannot be used on the relative variable keys generated by loop blocks. While they are still resolved inside of the block, their content is repeated which each loop iteration. {% endhint %}
A loop is written in the same way as a section. It begins with a hash #
and ends with a slash /
. Inside the loop, you place the key that represents the list or array item to be iterated over.
{% tabs %} {% tab title="Simple array" %}
{{ #simple }}
{{.}}
{{ /simple }}
{% endtab %}
{% tab title="Nested array" %}
{{ #nested }}
{{ name }}
{{ #nested }}
{% endtab %} {% endtabs %}
Using the following context:
{
"simple": ["Pied Piper", "Hooli", "Raviga"],
"nested": [
{ "name": "Richard Hendricks" },
{ "name": "Gavin Belson" },
{ "name": "Peter Gregory" }
]
}
{% tabs %} {% tab title="Simple array output" %}
Pied Piper
Hooli
Raviga
{% endtab %}
{% tab title="Nested array output" %}
Richard Hendricks
Gavin Belson
Peter Gregory
{% endtab %} {% endtabs %}