added click send to number

This commit is contained in:
Tarun Singh
2021-10-25 04:11:57 -04:00
parent fed611d1b9
commit ba1e025353
2 changed files with 8 additions and 6 deletions

View File

@@ -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);
}