+
+ https://whapi.cloud/
+
+
diff --git a/src/lang/en.json b/src/lang/en.json
index 8f63323ea1..683bb51bd9 100644
--- a/src/lang/en.json
+++ b/src/lang/en.json
@@ -883,5 +883,8 @@
"deleteRemoteBrowserMessage": "Are you sure want to delete this Remote Browser for all monitors?",
"GrafanaOncallUrl": "Grafana Oncall URL",
"Browser Screenshot": "Browser Screenshot",
- "wayToWriteWhapiPhoneNumber": "The phone number with the international prefix, but without the plus sign at the start"
+ "wayToWriteWhapiRecipient": "The phone number with the international prefix, but without the plus sign at the start ({0}), the Contact ID ({1}) or the Group ID ({2}).",
+ "wayToGetWhapiUrlAndToken": "You can get the API URL and the token by going into your desired channel from {0}",
+ "whapiRecipient": "Phone Number / Contact ID / Group ID",
+ "API URL": "API URL"
}
From e0743ce88bf3469182cdf80e4c30cbccecbecfc4 Mon Sep 17 00:00:00 2001
From: edo2313 <32812884+edo2313@users.noreply.github.com>
Date: Tue, 9 Jan 2024 00:36:59 +0100
Subject: [PATCH 4/6] Added placeholder and use default url if not specified
---
server/notification-providers/whapi.js | 2 +-
src/components/notifications/Whapi.vue | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/server/notification-providers/whapi.js b/server/notification-providers/whapi.js
index a13cb02849..2d1c289ded 100644
--- a/server/notification-providers/whapi.js
+++ b/server/notification-providers/whapi.js
@@ -27,7 +27,7 @@ class Whapi extends NotificationProvider {
"body": msg,
};
- let url = notification.whapiApiUrl + "/messages/text";
+ let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/\/+$/, "") + "/messages/text";
await axios.post(url, data, config);
diff --git a/src/components/notifications/Whapi.vue b/src/components/notifications/Whapi.vue
index d308cfce66..4c92ad2c3a 100644
--- a/src/components/notifications/Whapi.vue
+++ b/src/components/notifications/Whapi.vue
@@ -1,7 +1,7 @@
-
+
From 4c1d0827fb90e139c65de38646c26063e58ee0e7 Mon Sep 17 00:00:00 2001
From: Frank Elsinga
Date: Tue, 9 Jan 2024 01:48:49 +0100
Subject: [PATCH 5/6] changed the name of the notification provider
---
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 0377847ea3..d9f8191bb2 100644
--- a/src/components/NotificationDialog.vue
+++ b/src/components/NotificationDialog.vue
@@ -152,7 +152,7 @@ export default {
"webhook": "Webhook",
"GoAlert": "GoAlert",
"ZohoCliq": "ZohoCliq",
- "whapi": "Whapi",
+ "whapi": "WhatsApp (Whapi)",
};
// Put notifications here if it's not supported in most regions or its documentation is not in English
From 532bd2a50dce5066ea8f8fd9f51cb1b506a70119 Mon Sep 17 00:00:00 2001
From: Frank Elsinga
Date: Wed, 3 Apr 2024 02:14:36 +0200
Subject: [PATCH 6/6] formatting changes
---
server/notification-providers/whapi.js | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/server/notification-providers/whapi.js b/server/notification-providers/whapi.js
index 2d1c289ded..70e0fbb4c7 100644
--- a/server/notification-providers/whapi.js
+++ b/server/notification-providers/whapi.js
@@ -2,18 +2,15 @@ const NotificationProvider = require("./notification-provider");
const axios = require("axios");
class Whapi extends NotificationProvider {
-
name = "whapi";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
-
- let okMsg = "Sent Successfully.";
+ const okMsg = "Sent Successfully.";
try {
-
const config = {
headers: {
"Accept": "application/json",