Message Templates

Depending on the conditions that were selected, one of the following message templates will be used. You can choose from predefined message templates by clicking on the + symbol on the bottom right:

Or customize your own with advanced conditional statements:

Tip: you can see the full content of the possible fields to build templates, with:

{{body}}

IF

The vehicle reported: {% if body.label == "panic" %} panic button pressed {% endif %} {% if body.label == "spd" %} speeding event {% endif %}.

IF/ELSE

{% if body.valid_position %} position is valid {% else %} position is not valid {% endif %}

OPERATORS

In this example, the trigger identifies the temperature in each of the three temperature sensors (a, b and c) then sends a message when the threshold has been reached for each sensor, either for high or low temperature.

{% if body.temp_a__c >= 35 %}
    Temperature above 35°C detected in Sensor A, current value: {{body.temp_a__c}}°C
{% endif %}
{% if body.temp_b__c < 17 %}
    Temperature below 17°C detected in Sensor B, current value: {{body.temp_b__c}}°C
{% endif %}
{% if body.temp_avg__c >= 35 %}
    Average temperature from all sensors, above 35°C, current value: {{body.temp_avg__c}}°C
{% endif %}
{{object.name}} REPORTS {% if body.label == "ignon" %} ENGINE ON {% endif %}{% if body.label == "ignoff" %} ENGINE OFF {% endif %}{% if body.label == "pwrloss" %} TRACKING DEVICE POWER DISCONNECTED {% endif %}{% if body.label == "pwrrstd" %} TRACKING DEVICE POWER RESTORED {% endif %}{% if body.io_ign and body.mph > 65 %} OVER SPEED ALERT, TRAVELING AT {{body.mph}} {% endif %}{% if not body.io_ign and body.mph > 20 %} TOWING ALERT {% endif %}

You can modify the value of the parameters body.params with any of this operations, only need to follow the next format

{{body.sv | subtract:10}}
{{body.sv | multiply:10}}
{{body.sv | divide:10}}
{{body.sv | integer}}
{{body.sv | divide:10 | integer}}
Shows the name of the geofence the vehicle entered:

{{body.entered.0.properties.name}}
Shows the name of the geofence the vehicle exited:

{{body.exited.0.properties.name}}
Ignition is {% if body.io_ign %} ON {% else %} OFF {% endif %}

Dates

Dates can be modified to show in a custom format using:

Shows the current date and time:

{% now "H:i:s A" %}
{% now "h:i A" %}
{% now "l, M j Y H:i:s" %}
{% now "l, M j Y H:i A" %}
10:04:36 AM
10:04 AM
Friday, Dec 14 2018 10:04:36
Friday, Dec 14 2018 10:04 AM
You can also use the locale timestamp which adds translation:

{{body.locale_datetime}}
{{body.locale_datetime_short}}
Lunes Octubre 4 1:59:14 PM CST
Lun Oct 4 1:59:14 PM CST
{% load tz %}{% localtime off %}{{body.event_time|date:"l, Y j M H:i A T"}}{% endlocaltime %}
Lunes, 2022 21 Mar 14:17 PM EDT

Other Functions

  • timesince: Formats a date as the time since that date, for example, if you want to know the time since the event was generated from the device to the time it was received on the server, you can use:
    There was a {{body.event_time|timesince:body.system_time}} delay from the time the event was generated by the time it was received on the server.
    
    There was a 2 minutes delay from the time the event was generated by the time it was received on the server.
    
  • widthratio: Allows you to divide values, for example if you’re getting the bluetooth tag temperature it’s reported as: btt_temp: 235, to convert this to 23.5 use widthratio of 10, the format is:
    The temperature of the cargo: {% widthratio body.btt_temp 10 1 %}°C.
    
    The temperature of the cargo: 23.5°C.
    
    The hourmeter of the vehicle is: {% widthratio body.vehicle_dev_ign 3600 1 %}H
    
    The hourmeter of the vehicle is: 2318H