From ba02c70d321e739bca6647948b11b17af7859f89 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 03:59:15 +0000 Subject: [PATCH 01/16] MobivateSMS Notification Provider support --- server/notification-providers/mobivatesms.js | 47 ++++++++++++++++++++ server/notification.js | 1 + src/components/notifications/MobivateSMS.vue | 39 ++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 server/notification-providers/mobivatesms.js create mode 100644 src/components/notifications/MobivateSMS.vue diff --git a/server/notification-providers/mobivatesms.js b/server/notification-providers/mobivatesms.js new file mode 100644 index 000000000..ac9123808 --- /dev/null +++ b/server/notification-providers/mobivatesms.js @@ -0,0 +1,47 @@ +const NotificationProvider = require("./notification-provider"); +const axios = require("axios"); + +class MobivateSMS extends NotificationProvider { + name = "MobivateSMS"; + + /** + * @inheritdoc + */ + async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { + const okMsg = "Sent Successfully."; + const url = "https://vortex.mobivatebulksms.com/send/batch"; + + try { + // smspartner does not support non ascii characters and only a maximum 639 characters + let cleanMsg = msg.replace(/[^\x00-\x7F]/g, "").substring(0, 639); + + let data = { + "originator": notification.mobivateOriginator.substring(0, 15), + "recipients": notification.mobivateRecipients.split(',').map(n => n.replace(/[^0-9]/g,'')).filter(n => n.replace(/[^0-9]/g,'')), + "text": cleanMsg, + }; + + let config = { + headers: { + "Content-Type": "application/json", + "cache-control": "no-cache", + "Accept": "application/json", + "Authorization": "Bearer " + notification.mobivateApikey + } + }; + config = this.getAxiosConfigWithProxy(config); + + let resp = await axios.post(url, data, config); + + if (resp.data.success !== true) { + throw Error(`Api returned ${resp.data.response.status}.`); + } + + return okMsg; + } catch (error) { + this.throwGeneralAxiosError(error); + } + } +} + +module.exports = MobivateSMS; diff --git a/server/notification.js b/server/notification.js index e25bca08b..0a7857d3b 100644 --- a/server/notification.js +++ b/server/notification.js @@ -29,6 +29,7 @@ const LineNotify = require("./notification-providers/linenotify"); const LunaSea = require("./notification-providers/lunasea"); const Matrix = require("./notification-providers/matrix"); const Mattermost = require("./notification-providers/mattermost"); +const MobivateSMS = require("./notification-providers/mobivatesms"); const NextcloudTalk = require("./notification-providers/nextcloudtalk"); const Nostr = require("./notification-providers/nostr"); const Ntfy = require("./notification-providers/ntfy"); diff --git a/src/components/notifications/MobivateSMS.vue b/src/components/notifications/MobivateSMS.vue new file mode 100644 index 000000000..38cbce41f --- /dev/null +++ b/src/components/notifications/MobivateSMS.vue @@ -0,0 +1,39 @@ + + + From fa5891b3ce5feae3e7d41a805697e82b43e64256 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:04:11 +0000 Subject: [PATCH 02/16] fixes to mobivatesms --- server/notification-providers/mobivatesms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/mobivatesms.js b/server/notification-providers/mobivatesms.js index ac9123808..0ea0e034e 100644 --- a/server/notification-providers/mobivatesms.js +++ b/server/notification-providers/mobivatesms.js @@ -17,7 +17,7 @@ class MobivateSMS extends NotificationProvider { let data = { "originator": notification.mobivateOriginator.substring(0, 15), - "recipients": notification.mobivateRecipients.split(',').map(n => n.replace(/[^0-9]/g,'')).filter(n => n.replace(/[^0-9]/g,'')), + "recipients": notification.mobivateRecipients.split(",").map(n => n.replace(/[^0-9]/g, "")).filter(n => n.length > 10), "text": cleanMsg, }; From 340c1cc01bcc13fdc36b3112ef0ac284d034cfd1 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:04:58 +0000 Subject: [PATCH 03/16] spaces --- server/notification-providers/mobivatesms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/mobivatesms.js b/server/notification-providers/mobivatesms.js index 0ea0e034e..c34eb22c4 100644 --- a/server/notification-providers/mobivatesms.js +++ b/server/notification-providers/mobivatesms.js @@ -18,7 +18,7 @@ class MobivateSMS extends NotificationProvider { let data = { "originator": notification.mobivateOriginator.substring(0, 15), "recipients": notification.mobivateRecipients.split(",").map(n => n.replace(/[^0-9]/g, "")).filter(n => n.length > 10), - "text": cleanMsg, + "text": cleanMsg }; let config = { From d01787c27233ffe002e63efc2eb8914094612cc4 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:05:59 +0000 Subject: [PATCH 04/16] instantiate MobivateSMS --- server/notification.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/notification.js b/server/notification.js index 0a7857d3b..aafe6180e 100644 --- a/server/notification.js +++ b/server/notification.js @@ -129,6 +129,7 @@ class Notification { new LunaSea(), new Matrix(), new Mattermost(), + new MobivateSMS(), new NextcloudTalk(), new Nostr(), new Ntfy(), From 04b92b36dfbda2b708e45e674b58a257fe2aa0f3 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:11:00 +0000 Subject: [PATCH 05/16] Adding Mobivate SMS to the list of Notification Providers --- src/components/NotificationDialog.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 98df20abb..bf281bfb7 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -133,6 +133,7 @@ export default { "lunasea": "LunaSea", "matrix": "Matrix", "mattermost": "Mattermost", + "mobivatesms":" "Mobivate SMS", "nextcloudtalk": "Nextcloud Talk", "nostr": "Nostr", "ntfy": "Ntfy", From 11c4b2e182054ca6ac9c9150e8a5c0e20612de62 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:12:30 +0000 Subject: [PATCH 06/16] oops --- src/components/NotificationDialog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index bf281bfb7..e9b027fb5 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -133,7 +133,7 @@ export default { "lunasea": "LunaSea", "matrix": "Matrix", "mattermost": "Mattermost", - "mobivatesms":" "Mobivate SMS", + "mobivatesms": "Mobivate SMS", "nextcloudtalk": "Nextcloud Talk", "nostr": "Nostr", "ntfy": "Ntfy", From f5864289c834d2f3795503e6c58b697021f6c991 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:22:59 +0000 Subject: [PATCH 07/16] lets gooo --- src/components/NotificationDialog.vue | 2 +- src/components/notifications/MobivateSMS.vue | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index e9b027fb5..f11d4ec97 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -133,7 +133,7 @@ export default { "lunasea": "LunaSea", "matrix": "Matrix", "mattermost": "Mattermost", - "mobivatesms": "Mobivate SMS", + "MobivateSMS": "Mobivate SMS", "nextcloudtalk": "Nextcloud Talk", "nostr": "Nostr", "ntfy": "Ntfy", diff --git a/src/components/notifications/MobivateSMS.vue b/src/components/notifications/MobivateSMS.vue index 38cbce41f..e27a90574 100644 --- a/src/components/notifications/MobivateSMS.vue +++ b/src/components/notifications/MobivateSMS.vue @@ -3,20 +3,20 @@
- +
+447xxxxxxx1 +447xxxxxxx2 , - +
From ef0fff993d5b4d5760be40a1793e0d5c7b93e538 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:28:04 +0000 Subject: [PATCH 08/16] debug --- server/notification-providers/mobivatesms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/mobivatesms.js b/server/notification-providers/mobivatesms.js index c34eb22c4..eac5fb2f7 100644 --- a/server/notification-providers/mobivatesms.js +++ b/server/notification-providers/mobivatesms.js @@ -10,7 +10,7 @@ class MobivateSMS extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; const url = "https://vortex.mobivatebulksms.com/send/batch"; - +console.log('notification', notification, 'msg', msg); try { // smspartner does not support non ascii characters and only a maximum 639 characters let cleanMsg = msg.replace(/[^\x00-\x7F]/g, "").substring(0, 639); From 54143595d9927840478a29d42d95e0bf484c0c87 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:33:08 +0000 Subject: [PATCH 09/16] less text --- src/components/notifications/MobivateSMS.vue | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/components/notifications/MobivateSMS.vue b/src/components/notifications/MobivateSMS.vue index e27a90574..adbc2f895 100644 --- a/src/components/notifications/MobivateSMS.vue +++ b/src/components/notifications/MobivateSMS.vue @@ -1,30 +1,15 @@ From 8b2b4b038443878a901151ade7d7751e15de1d97 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:43:50 +0000 Subject: [PATCH 10/16] added to export list --- src/components/notifications/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/notifications/index.js b/src/components/notifications/index.js index 9bc4f050d..7377acec8 100644 --- a/src/components/notifications/index.js +++ b/src/components/notifications/index.js @@ -28,6 +28,7 @@ import LineNotify from "./LineNotify.vue"; import LunaSea from "./LunaSea.vue"; import Matrix from "./Matrix.vue"; import Mattermost from "./Mattermost.vue"; +import MobivateSMS from "./MobivateSMS.vue"; import NextcloudTalk from "./NextcloudTalk.vue"; import Nostr from "./Nostr.vue"; import Ntfy from "./Ntfy.vue"; @@ -116,6 +117,7 @@ const NotificationFormList = { "lunasea": LunaSea, "matrix": Matrix, "mattermost": Mattermost, + "MobivateSMS": MobivateSMS, "nextcloudtalk": NextcloudTalk, "nostr": Nostr, "ntfy": Ntfy, From 7d0a7062e6ff25be8e3b987eb29b41f76551c3ea Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:47:53 +0000 Subject: [PATCH 11/16] added text --- src/components/notifications/MobivateSMS.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/notifications/MobivateSMS.vue b/src/components/notifications/MobivateSMS.vue index adbc2f895..10cb8e55d 100644 --- a/src/components/notifications/MobivateSMS.vue +++ b/src/components/notifications/MobivateSMS.vue @@ -4,11 +4,14 @@
- + +
+

{{ $t("Comma separated list of numbers in international format. (eg. 447930000000,447930000001)") }}

+
- +
From 672f69c522208924dccf9c363d1413481b3e9c10 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:53:28 +0000 Subject: [PATCH 12/16] debug --- server/notification-providers/mobivatesms.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/notification-providers/mobivatesms.js b/server/notification-providers/mobivatesms.js index eac5fb2f7..1fd998326 100644 --- a/server/notification-providers/mobivatesms.js +++ b/server/notification-providers/mobivatesms.js @@ -1,5 +1,6 @@ const NotificationProvider = require("./notification-provider"); const axios = require("axios"); +const { log } = require("../../src/util"); class MobivateSMS extends NotificationProvider { name = "MobivateSMS"; @@ -10,7 +11,7 @@ class MobivateSMS extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; const url = "https://vortex.mobivatebulksms.com/send/batch"; -console.log('notification', notification, 'msg', msg); + try { // smspartner does not support non ascii characters and only a maximum 639 characters let cleanMsg = msg.replace(/[^\x00-\x7F]/g, "").substring(0, 639); @@ -31,6 +32,9 @@ console.log('notification', notification, 'msg', msg); }; config = this.getAxiosConfigWithProxy(config); + console.log('Sending to', url, data, config); + log.debug("mobivate", "Sending to ", url, data, config); + let resp = await axios.post(url, data, config); if (resp.data.success !== true) { From 13fd82708b15e175dca4c12f51254fc55f12af87 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:54:38 +0000 Subject: [PATCH 13/16] filter numbers --- server/notification-providers/mobivatesms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/mobivatesms.js b/server/notification-providers/mobivatesms.js index 1fd998326..521552891 100644 --- a/server/notification-providers/mobivatesms.js +++ b/server/notification-providers/mobivatesms.js @@ -18,7 +18,7 @@ class MobivateSMS extends NotificationProvider { let data = { "originator": notification.mobivateOriginator.substring(0, 15), - "recipients": notification.mobivateRecipients.split(",").map(n => n.replace(/[^0-9]/g, "")).filter(n => n.length > 10), + "recipients": notification.mobivateRecipients.split(",").map(n => n.replace(/[^0-9]/g, "")).filter(n => n.length >= 9), "text": cleanMsg }; From c1b15d2cfbda00a58143e64431af720433ee4160 Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 04:59:01 +0000 Subject: [PATCH 14/16] correct format of the recipients --- server/notification-providers/mobivatesms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/mobivatesms.js b/server/notification-providers/mobivatesms.js index 521552891..64e3d2ab0 100644 --- a/server/notification-providers/mobivatesms.js +++ b/server/notification-providers/mobivatesms.js @@ -18,7 +18,7 @@ class MobivateSMS extends NotificationProvider { let data = { "originator": notification.mobivateOriginator.substring(0, 15), - "recipients": notification.mobivateRecipients.split(",").map(n => n.replace(/[^0-9]/g, "")).filter(n => n.length >= 9), + "recipients": notification.mobivateRecipients.split(",").map(n => n.replace(/[^0-9]/g, "")).filter(n => n.length >= 9).map(recipient => ({recipient})), "text": cleanMsg }; From 635ef0d46d38ee5b7190bdb52bb09fa89679bf5c Mon Sep 17 00:00:00 2001 From: John Huseinovic Date: Thu, 4 Dec 2025 05:06:05 +0000 Subject: [PATCH 15/16] removing logs --- server/notification-providers/mobivatesms.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/server/notification-providers/mobivatesms.js b/server/notification-providers/mobivatesms.js index 64e3d2ab0..ce6c767a8 100644 --- a/server/notification-providers/mobivatesms.js +++ b/server/notification-providers/mobivatesms.js @@ -1,6 +1,5 @@ const NotificationProvider = require("./notification-provider"); const axios = require("axios"); -const { log } = require("../../src/util"); class MobivateSMS extends NotificationProvider { name = "MobivateSMS"; @@ -32,9 +31,6 @@ class MobivateSMS extends NotificationProvider { }; config = this.getAxiosConfigWithProxy(config); - console.log('Sending to', url, data, config); - log.debug("mobivate", "Sending to ", url, data, config); - let resp = await axios.post(url, data, config); if (resp.data.success !== true) { From c03fda0d73015d1470e76215cb7086e8e8e79e8e Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 9 Jan 2026 04:23:50 +0000 Subject: [PATCH 16/16] [autofix.ci] apply automated fixes --- server/notification-providers/mobivatesms.js | 16 +++++---- src/components/notifications/MobivateSMS.vue | 34 +++++++++++++++++--- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/server/notification-providers/mobivatesms.js b/server/notification-providers/mobivatesms.js index ce6c767a8..7a03e62c7 100644 --- a/server/notification-providers/mobivatesms.js +++ b/server/notification-providers/mobivatesms.js @@ -16,18 +16,22 @@ class MobivateSMS extends NotificationProvider { let cleanMsg = msg.replace(/[^\x00-\x7F]/g, "").substring(0, 639); let data = { - "originator": notification.mobivateOriginator.substring(0, 15), - "recipients": notification.mobivateRecipients.split(",").map(n => n.replace(/[^0-9]/g, "")).filter(n => n.length >= 9).map(recipient => ({recipient})), - "text": cleanMsg + originator: notification.mobivateOriginator.substring(0, 15), + recipients: notification.mobivateRecipients + .split(",") + .map((n) => n.replace(/[^0-9]/g, "")) + .filter((n) => n.length >= 9) + .map((recipient) => ({ recipient })), + text: cleanMsg, }; let config = { headers: { "Content-Type": "application/json", "cache-control": "no-cache", - "Accept": "application/json", - "Authorization": "Bearer " + notification.mobivateApikey - } + Accept: "application/json", + Authorization: "Bearer " + notification.mobivateApikey, + }, }; config = this.getAxiosConfigWithProxy(config); diff --git a/src/components/notifications/MobivateSMS.vue b/src/components/notifications/MobivateSMS.vue index 10cb8e55d..d5c44bc94 100644 --- a/src/components/notifications/MobivateSMS.vue +++ b/src/components/notifications/MobivateSMS.vue @@ -1,18 +1,44 @@