From 2f451c589332d076a6e8af315168bca46e00cc23 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Mon, 15 Jul 2019 20:45:36 +0100 Subject: [PATCH] Always start a sender number with + on twillio --- lib/plugins/sms/twilio/twilio.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/plugins/sms/twilio/twilio.js b/lib/plugins/sms/twilio/twilio.js index 7b87b19d..68a7ddb7 100644 --- a/lib/plugins/sms/twilio/twilio.js +++ b/lib/plugins/sms/twilio/twilio.js @@ -14,11 +14,13 @@ function sendMessage (account, rec) { const client = twilio(account.accountSid, account.authToken) const body = rec.sms.body const _toNumber = rec.sms.toNumber || account.toNumber + const from = _.startsWith('+')(account.fromNumber) + ? account.fromNumber : `+${account.fromNumber}` const opts = { body: body, to: _toNumber, - from: account.fromNumber + from } return client.messages.create(opts)