How to create SMS HTTP template matching event types

sdntech19 days ago

Hi All,
I have notifications enabled for multiple devices, such as geofence exits and speed exceedances. These notifications are sent via email, complete with event names and details.

Additionally, I have ClickSend integrated to receive SMS alerts when events trigger. However, I'm unsure how to configure the SMS HTTP template. Do I need to create a separate template for each event? Also, will I need to replicate the template for unique phone numbers if I have multiple devices?
Please see a snippet of the template below; I only receive SMS messages containing a string value as shown in the body.

<entry key='sms.http.template'>
{
    "messages": [
        {
            "source": "MyFleet",
            "body": "{event}",
            "to": "+xxxxx"
        },
        {
            "source": "Traccar",
            "body": "{event}",
            "to": "+xxxxx"
        }
    ]
}
Anton Tananaev19 days ago

There's already a separate message template for each event type.

sdntech19 days ago

Thank You, Anton, I did some research within the forum and found this - https://github.com/traccar/traccar/commit/f53d4c24cd7cc4b7cbd3bd043f8d1e95c72d24e4

Does that mean templates are enabled by default? I would appreciate if you could point me to some documentation.

Anton Tananaev19 days ago

Yes, we always use templates for notifications. The documentation is here:

https://www.traccar.org/notifications/