feat: admin picked sms provider

This commit is contained in:
Rafael Taranto 2023-08-19 10:56:54 +01:00
parent 3b19caf3a7
commit f716e4202c
3 changed files with 89 additions and 1 deletions

View file

@ -25,7 +25,8 @@ function getSms (event, phone, content) {
}
function getPlugin (settings) {
const pluginCode = argv.mockSms ? 'mock-sms' : argv.telnyxSms ? 'telnyx' : 'twilio'
const smsProvider = settings.config.notifications_thirdParty_provider
const pluginCode = smsProvider ?? 'twilio'
const plugin = ph.load(ph.SMS, pluginCode)
const account = settings.accounts[pluginCode]