From 7906e5a1a03560fd8e84eb7e27ef56605f5519b6 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Fri, 30 Dec 2016 17:22:51 +0100 Subject: [PATCH] sms contains controller id --- app/server/methods.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/server/methods.js b/app/server/methods.js index 9bc2ba3..07d15ca 100644 --- a/app/server/methods.js +++ b/app/server/methods.js @@ -265,18 +265,18 @@ function soundTheAlarm(controller_id, tooCold, tooHot, boxSilent, phoneSilent) { }); if (needsToSendSms) { - sendAlarmingSms(reason, state.config.smsNumbers) + sendAlarmingSms(controller_id,reason, state.config.smsNumbers) } } -function sendAlarmingSms(reason, numbers) { +function sendAlarmingSms(controller_id,reason, numbers) { for (var i in numbers) { var number = numbers[i]; twilio = Twilio('AC10d7ed0bf54c1be4b1cd7133130e63f4', 'e133d3f02a69b79e93ad9ca1d73517d1'); twilio.sendSms({ to: number, // Any number Twilio can deliver to from: '+447481345235', // A number you bought from Twilio and can use for outbound communication - body: 'Zoblak alarm! Pokrenite aplikaciju! HITNO! http://agrar.zoblak.com' // body of the SMS message + body: 'Zoblak alarm! Pokrenite aplikaciju! HITNO! http://agrar.zoblak.com/alarm?controller_id=' + controller_id // body of the SMS message }, function(err, responseData) { //this function is executed when a response is received from Twilio if (!err) { // "err" is an error received during the request, if any // "responseData" is a JavaScript object containing data received from Twilio.