feat: add Plivo SMS notification provider (#7584)

This commit is contained in:
Sarvesh Patil
2026-07-13 13:05:39 +05:30
committed by GitHub
parent 919f080184
commit 62a2d01d3f
6 changed files with 120 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
class Plivo extends NotificationProvider {
name = "plivo";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
try {
let config = {
headers: {
"Content-Type": "application/json",
Authorization:
"Basic " +
Buffer.from(notification.plivoAuthID + ":" + notification.plivoAuthToken).toString("base64"),
},
};
config = this.getAxiosConfigWithProxy(config);
const data = {
src: notification.plivoFromNumber,
dst: notification.plivoToNumber,
text: msg,
};
await axios.post(`https://api.plivo.com/v1/Account/${notification.plivoAuthID}/Message/`, data, config);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = Plivo;
+2
View File
@@ -45,6 +45,7 @@ const Pumble = require("./notification-providers/pumble");
const FlashDuty = require("./notification-providers/flashduty");
const Flowtriq = require("./notification-providers/flowtriq");
const PagerTree = require("./notification-providers/pagertree");
const Plivo = require("./notification-providers/plivo");
const PromoSMS = require("./notification-providers/promosms");
const Pushbullet = require("./notification-providers/pushbullet");
const PushDeer = require("./notification-providers/pushdeer");
@@ -158,6 +159,7 @@ class Notification {
new FlashDuty(),
new Flowtriq(),
new PagerTree(),
new Plivo(),
new PromoSMS(),
new Pumble(),
new Pushbullet(),