chore: server code formatting
This commit is contained in:
parent
aedabcbdee
commit
68517170e2
234 changed files with 9824 additions and 6195 deletions
|
|
@ -2,20 +2,19 @@ const Telnyx = require('telnyx')
|
|||
|
||||
const NAME = 'Telnyx'
|
||||
|
||||
function sendMessage (account, rec) {
|
||||
function sendMessage(account, rec) {
|
||||
const telnyx = Telnyx(account.apiKey)
|
||||
|
||||
const from = account.fromNumber
|
||||
const text = rec.sms.body
|
||||
const to = rec.sms.toNumber || account.toNumber
|
||||
|
||||
return telnyx.messages.create({ from, to, text })
|
||||
.catch(err => {
|
||||
throw new Error(`Telnyx error: ${err.message}`)
|
||||
})
|
||||
return telnyx.messages.create({ from, to, text }).catch(err => {
|
||||
throw new Error(`Telnyx error: ${err.message}`)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
NAME,
|
||||
sendMessage
|
||||
sendMessage,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue