SMS Gateway Question

ritesh2 years ago

I am send some notification to my next server. I want to send latitude and longitude also. if this possible?

<entry key='notificator.types'>web,mail,sms</entry>
<entry key='sms.http.url'>https://api.myserver.com/v1/messages</entry>
<entry key='sms.http.user'>[YOUR TOKEN ID]</entry>
<entry key='sms.http.password'>[YOUR TOKEN SECRET]</entry>
<entry key='sms.http.template'>
    {
        "to": "{phone}",
        "body": "{message} at {{latitude}},{{longitude}}"
    }
</entry>

How to get lat and log there?
If possible let me know, THANKS IN ADVANCE

Anton Tananaev2 years ago

Definitely possible, but not the way you're trying to do it. You should change the short notification templates in the templates folder.

ritesh2 years ago

i only want to do for sms not for firebase notification if there a way to add logic to template?

Anton Tananaev2 years ago

No, in that case it's not possible.

ritesh2 years ago

i have this in .vm throw erorr

#set($subject = "$device.name: moving")
$device.name moving at $dateTool.format("YYYY-MM-dd HH:mm:ss", $event.eventTime, $locale, $timezone)
$position.latitude
Anton Tananaev2 years ago

Are you going to share the error?

ritesh2 years ago

How to send title or subject of template/shorts/deviceOnline.vm

<entry key='notificator.types'>web,mail,sms</entry>
<entry key='sms.http.url'>https://api.myserver.com/v1/messages</entry>
<entry key='sms.http.user'>[YOUR TOKEN ID]</entry>
<entry key='sms.http.password'>[YOUR TOKEN SECRET]</entry>
<entry key='sms.http.template'>
    {
        "to": "{phone}",
        "body": "{subject}\n{message}"
    }
</entry>

but i am getting..

{subject}
my scooter online at 2022-12-27 19:21:01
Anton Tananaev2 years ago

As I already said, you cannot add anything else to the configuration template. You have to change the template file instead.

ritesh2 years ago

yes but i want value from template
here in my vim file

#set($subject = "Fuel drop at $position.address ")
$device.name fuel drop at $dateTool.format("HH:mm", $event.eventTime, $locale, >

i want to get set $subject value to send sms

<entry key='sms.http.template'>
    {
        "to": "{phone}",
        "body": "{subject}\n{message}"
    }
</entry>
Anton Tananaev2 years ago

In case you're still not clear about the answer, it's not possible.

ritesh2 years ago

haha ok