Twilio adventures

MJ5 years ago

For the benefit of others I post the following...
Adding Twilio details in /conf/traccar.xml prevented my Traccar server from starting, or so I thought. It turns out that ignoring the SMTP errors was stupid. The culprit that helped me find the solution was the line:

<entry key='notificator.types'>web,mail,sms</entry>. 

With 'mail' enabled but not configured the server refused to start. I tore my hair out for a couple of days...
Note: <entry key='sms.enable'>true</entry> is not required.

Working now with this, yay!

<!-- SMTP -->
<entry key='mail.smtp.host'>mail.mydomain</entry>
<entry key='mail.smtp.port'>465</entry>
<entry key='mail.smtp.ssl.enable'>true</entry>
<entry key='mail.smtp.from'>me@mydomain</entry>
<entry key='mail.smtp.auth'>true</entry>
<entry key='mail.smtp.username'>me@mydomain</entry>
<entry key='mail.smtp.password'>My_PASSWORD</entry>

<!-- Twilio SMS -->
<entry key='notificator.types'>web,mail,sms</entry>
<entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>https://api.twilio.com/2010-04-01/Accounts/My_SID/Messages.json</entry>
<entry key='sms.http.user'>My_SID</entry>
<entry key='sms.http.password'>My_AUTH_TOKEN</entry>
<entry key='sms.http.template'>From=%2BMy_PHONE&amp;To={phone}&amp;Body={message}</entry>