diff --git a/server/notification-providers/twilio.js b/server/notification-providers/twilio.js index 8f4db0404..a908fb21e 100644 --- a/server/notification-providers/twilio.js +++ b/server/notification-providers/twilio.js @@ -10,6 +10,7 @@ class Twilio extends NotificationProvider { let okMsg = "Sent Successfully."; let accountSID = notification.twilioAccountSID; + let apiKey = notification.twilioApiKey ? notification.twilioApiKey : accountSID; let authToken = notification.twilioAuthToken; try { @@ -17,7 +18,7 @@ class Twilio extends NotificationProvider { let config = { headers: { "Content-Type": "application/x-www-form-urlencoded;charset=utf-8", - "Authorization": "Basic " + Buffer.from(accountSID + ":" + authToken).toString("base64"), + "Authorization": "Basic " + Buffer.from(apiKey + ":" + authToken).toString("base64"), } }; diff --git a/src/components/notifications/Twilio.vue b/src/components/notifications/Twilio.vue index 3edf1e3df..d923866b0 100644 --- a/src/components/notifications/Twilio.vue +++ b/src/components/notifications/Twilio.vue @@ -5,7 +5,18 @@
- + + +
+

+ The API key is optional but recommended. You can provide either Account SID and AuthToken + from the may TwilioConsole page or Account SID and the pair of Api Key and Api Key secret +

+
+
+ +
+
diff --git a/src/lang/en.json b/src/lang/en.json index 21364d7c7..7a686cd5d 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -730,7 +730,8 @@ "ntfyAuthenticationMethod": "Authentication Method", "ntfyUsernameAndPassword": "Username and Password", "twilioAccountSID": "Account SID", - "twilioAuthToken": "Auth Token", + "twilioApiKey": "Api Key (optional)", + "twilioAuthToken": "Auth Token / Api Key Secret", "twilioFromNumber": "From Number", "twilioToNumber": "To Number", "Monitor Setting": "{0}'s Monitor Setting",