mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-25 21:54:16 -08:00
added click send to number
This commit is contained in:
parent
fed611d1b9
commit
ba1e025353
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,9 +12,13 @@
|
|||
<div class="mb-3">
|
||||
<div class="form-text">
|
||||
{{ $t("checkPrice", [$t("clicksendsms")]) }}
|
||||
<a href="https://www.clicksend.com/us/pricing" target="_blank">here</a>
|
||||
<a href="https://www.clicksend.com/us/pricing" target="_blank">https://clicksend.com/us/pricing</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="clicksendsms-to-number" class="form-label">Recipient Number</label>
|
||||
<input id="clicksendsms-to-number" v-model="$parent.notification.clicksendsmsToNumber" type="text" minlength="8" maxlength="14" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="clicksendsms-sender-name" class="form-label">From Name/Number -
|
||||
<a href="https://help.clicksend.com/article/4kgj7krx00-what-is-a-sender-id-or-sender-number" target="_blank">More Info</a>
|
||||
|
@ -23,7 +27,6 @@
|
|||
<div class="form-text">Leave blank to use a shared sender number.</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HiddenInput from "../HiddenInput.vue";
|
||||
|
||||
|
|
Loading…
Reference in a new issue