DevicePilot template language

This page describes the template syntax for notifications

You can customise the notifications sent by DevicePilot using any properties on the device or notification trigger. We use a standard template grammar called Handlebars (which is an extension to Moustache, named for the curly brackets it uses looking like facial hair).

Here is a simple example:

Device {{source.label}} is down!

which will transform to

Device Ada St & Washington Blvd is down!

The double curly brackets open a replacement, and in this case we're going to take the value of the label property on the device. You can access any property on your device this way.

You also have access to information about the monitor that triggered:

{{monitor.name}} - the name of the monitor

{{monitor.$ts}} - the timestamp of this trigger

{{monitor.state}} - true/false. true: the trigger has just fired, false: the trigger has just cleared

{{monitor.url}} - a URL that will open the affected device(s) in DevicePilot