From ec30147a7ffc459c0adc360cefe5d7a85c68e69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Szczepa=C5=84ski?= Date: Wed, 11 Jan 2023 14:32:57 +0100 Subject: [PATCH] Add option for allowing long sms in PromoSMS --- server/notification-providers/promosms.js | 6 +++++- src/components/notifications/PromoSMS.vue | 6 +++--- src/languages/en.js | 2 +- src/languages/pl.js | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/server/notification-providers/promosms.js b/server/notification-providers/promosms.js index 6992171be..05db61298 100644 --- a/server/notification-providers/promosms.js +++ b/server/notification-providers/promosms.js @@ -8,6 +8,10 @@ class PromoSMS extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { let okMsg = "Sent Successfully."; + if (notification.promosmsAllowLongSMS === undefined) { + notification.promosmsAllowLongSMS = false + } + try { let config = { headers: { @@ -20,7 +24,7 @@ class PromoSMS extends NotificationProvider { "recipients": [ notification.promosmsPhoneNumber ], //Lets remove non ascii char "text": msg.replace(/[^\x00-\x7F]/g, ""), - "long-sms": notification.promosmsAllowLong, + "long-sms": notification.promosmsAllowLongSMS, "type": Number(notification.promosmsSMSType), "sender": notification.promosmsSenderName }; diff --git a/src/components/notifications/PromoSMS.vue b/src/components/notifications/PromoSMS.vue index 9fe9c2172..15ed241b7 100644 --- a/src/components/notifications/PromoSMS.vue +++ b/src/components/notifications/PromoSMS.vue @@ -26,9 +26,9 @@ -
- - +
+ +
diff --git a/src/languages/en.js b/src/languages/en.js index 52803abb0..9c19c2daf 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -320,7 +320,7 @@ export default { promosmsTypeSpeed: "SMS SPEED - Highest priority in system. Very quick and reliable but costly (about twice of SMS FULL price).", promosmsPhoneNumber: "Phone number (for Polish recipient You can skip area codes)", promosmsSMSSender: "SMS Sender Name : Pre-registred name or one of defaults: InfoSMS, SMS Info, MaxSMS, INFO, SMS", - promosmsAllowLong: "Allow long messages", + promosmsAllowLongSMS: "Allow long SMS", "Feishu WebHookUrl": "Feishu WebHookURL", matrixHomeserverURL: "Homeserver URL (with http(s):// and optionally port)", "Internal Room Id": "Internal Room ID", diff --git a/src/languages/pl.js b/src/languages/pl.js index 35f5320e0..beef5df5b 100644 --- a/src/languages/pl.js +++ b/src/languages/pl.js @@ -284,7 +284,7 @@ export default { promosmsTypeSpeed: "SMS SPEED - wysyłka priorytetowa, ma wszystkie zalety SMS FULL", promosmsPhoneNumber: "Numer odbiorcy", promosmsSMSSender: "Nadawca SMS (wcześniej zatwierdzone nazwy z panelu PromoSMS)", - promosmsAllowLong: "Zezwól na długie wiadomości", + promosmsAllowLongSMS: "Zezwól na długie SMSy", "Primary Base URL": "Główny URL", "Push URL": "Push URL", needPushEvery: "Powinieneś wywoływać ten URL co {0} sekund",