From ba1e025353c579104d551adb05df93a2ae735508 Mon Sep 17 00:00:00 2001 From: Tarun Singh Date: Mon, 25 Oct 2021 04:11:57 -0400 Subject: [PATCH] added click send to number --- server/notification-providers/clicksendsms.js | 7 +++---- src/components/notifications/ClickSendSMS.vue | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server/notification-providers/clicksendsms.js b/server/notification-providers/clicksendsms.js index a5075af7..74e2f4c5 100644 --- a/server/notification-providers/clicksendsms.js +++ b/server/notification-providers/clicksendsms.js @@ -20,16 +20,15 @@ class ClickSendSMS extends NotificationProvider { messages: [ { "body": msg.replace(/[^\x00-\x7F]/g, ""), - // TODO: To phone number concept to be added - "to": "+61411111111", + "to": notification.clicksendsmsToNumber, "source": "uptime-kuma", "from": notification.clicksendsmsSenderName, } ] }; let resp = await axios.post("https://rest.clicksend.com/v3/sms/send", data, config); - if (resp.data.http_code !== 200) { - let error = "Something gone wrong. Api returned " + resp.data.response.status + "."; + if (resp.data.data.messages[0].status !== "SUCCESS") { + let error = "Something gone wrong. Api returned " + resp.data.data.messages[0].status + "."; this.throwGeneralAxiosError(error); } diff --git a/src/components/notifications/ClickSendSMS.vue b/src/components/notifications/ClickSendSMS.vue index 6e23aebe..2aed4184 100644 --- a/src/components/notifications/ClickSendSMS.vue +++ b/src/components/notifications/ClickSendSMS.vue @@ -12,9 +12,13 @@
{{ $t("checkPrice", [$t("clicksendsms")]) }} - here + https://clicksend.com/us/pricing
+
+ + +
-