|
|
|
@ -10,21 +10,18 @@ class GtxMessaging extends NotificationProvider {
|
|
|
|
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
|
|
|
|
const okMsg = "Sent Successfully.";
|
|
|
|
|
|
|
|
|
|
let authKey = notification.gtxMessagingApiKey;
|
|
|
|
|
let from = notification.gtxMessagingFrom.trim();
|
|
|
|
|
let to = notification.gtxMessagingTo.trim();
|
|
|
|
|
let text = msg.replaceAll("🔴 ", "").replaceAll("✅ ", "");
|
|
|
|
|
const from = notification.gtxMessagingFrom.trim();
|
|
|
|
|
const to = notification.gtxMessagingTo.trim();
|
|
|
|
|
// The UP/DOWN symbols will be replaced with `???` by gtx-messaging
|
|
|
|
|
const text = msg.replaceAll("🔴 ", "").replaceAll("✅ ", "");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
let data = new URLSearchParams();
|
|
|
|
|
const data = new URLSearchParams();
|
|
|
|
|
data.append("from", from);
|
|
|
|
|
data.append("to", to);
|
|
|
|
|
data.append("text", text);
|
|
|
|
|
|
|
|
|
|
let url = `https://rest.gtx-messaging.net/smsc/sendsms/${authKey}/json`;
|
|
|
|
|
|
|
|
|
|
console.log(`will post url: ${url}, data:`, data);
|
|
|
|
|
const url = `https://rest.gtx-messaging.net/smsc/sendsms/${notification.gtxMessagingApiKey}/json`;
|
|
|
|
|
|
|
|
|
|
await axios.post(url, data);
|
|
|
|
|
|
|
|
|
|