From 1ece0faa76e6eefed908234cc4873fa85d88dc37 Mon Sep 17 00:00:00 2001
From: lci-sinersio <113027200+lci-sinersio@users.noreply.github.com>
Date: Mon, 3 Jun 2024 14:19:31 +0200
Subject: [PATCH 1/4] Update serwersms.js
Adds the ability to use group_id
---
server/notification-providers/serwersms.js | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/server/notification-providers/serwersms.js b/server/notification-providers/serwersms.js
index f7c8644af..0a08e7ffd 100644
--- a/server/notification-providers/serwersms.js
+++ b/server/notification-providers/serwersms.js
@@ -17,6 +17,8 @@ class SerwerSMS extends NotificationProvider {
"Content-Type": "application/json",
}
};
+
+ // Użyj telefonu jako pierwszej opcji
let data = {
"username": notification.serwersmsUsername,
"password": notification.serwersmsPassword,
@@ -27,6 +29,13 @@ class SerwerSMS extends NotificationProvider {
let resp = await axios.post(url, data, config);
+ if (!resp.data.success) {
+ // If unsuccessful, try using group_id
+ data.phone = null; // Clear phone number
+ data.group_id = notification.serwersmsPhoneNumber;
+ resp = await axios.post(url, data, config);
+ }
+
if (!resp.data.success) {
if (resp.data.error) {
let error = `SerwerSMS.pl API returned error code ${resp.data.error.code} (${resp.data.error.type}) with error message: ${resp.data.error.message}`;
From 665d930edc037720066caf24695c02453893a8bd Mon Sep 17 00:00:00 2001
From: lci-sinersio <113027200+lci-sinersio@users.noreply.github.com>
Date: Mon, 3 Jun 2024 14:23:13 +0200
Subject: [PATCH 2/4] Update pl.json
Adds a translation
---
src/lang/pl.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lang/pl.json b/src/lang/pl.json
index 9f941e328..7e6c54152 100644
--- a/src/lang/pl.json
+++ b/src/lang/pl.json
@@ -361,6 +361,7 @@
"serwersmsAPIUser": "Nazwa użytkownika API (z prefiksem webapi_)",
"serwersmsAPIPassword": "Hasło API",
"serwersmsPhoneNumber": "Numer telefonu",
+ "serwersmsPhoneNumberGroupId": "Numer telefonu lub ID Grupy",
"serwersmsSenderName": "Nazwa nadawcy (zatwierdzona w panelu klienta)",
"smseagle": "SMSEagle",
"smseagleTo": "Numer/y telefonu",
From 710e8fdf460b034b114621d8caa69d8b81f4fb79 Mon Sep 17 00:00:00 2001
From: lci-sinersio <113027200+lci-sinersio@users.noreply.github.com>
Date: Mon, 3 Jun 2024 14:24:10 +0200
Subject: [PATCH 3/4] Update SerwerSMS.vue
Adds a description that group id can be used
---
src/components/notifications/SerwerSMS.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/notifications/SerwerSMS.vue b/src/components/notifications/SerwerSMS.vue
index 32a0ff7a8..5d7398bd6 100644
--- a/src/components/notifications/SerwerSMS.vue
+++ b/src/components/notifications/SerwerSMS.vue
@@ -8,7 +8,7 @@