fix: added missing lodash dependency to accounts lib
fix: don't prepend '+' when using a friendly name with Twilio fix: consider that the phone number may contain whitespaces fix: removed duplicated import on accounts.js fix: replaced isNan with lodash's _.isNumber fix: _isNumber logic was inverted
This commit is contained in:
parent
8564c8b727
commit
72a1b798f8
1 changed files with 2 additions and 1 deletions
|
|
@ -14,7 +14,8 @@ 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)
|
||||
const from = (_.startsWith('+')(account.fromNumber)
|
||||
|| !_.isNumber(String(account.fromNumber).replace(/\s/g,'')))
|
||||
? account.fromNumber : `+${account.fromNumber}`
|
||||
|
||||
const opts = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue