mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-03 20:14:21 -04:00
add octopush notification service
This commit is contained in:
parent
6a8ccf627a
commit
ed93aae1c2
2 changed files with 59 additions and 0 deletions
|
@ -193,6 +193,33 @@ class Notification {
|
|||
console.log(error)
|
||||
return false;
|
||||
}
|
||||
} else if (notification.type === "octopush") {
|
||||
try {
|
||||
let config = {
|
||||
headers: {
|
||||
'api-key': notification.octopushAPIKey,
|
||||
'api-login': notification.octopushLogin,
|
||||
'cache-control': 'no-cache'
|
||||
}
|
||||
};
|
||||
let data = {
|
||||
"recipients": [
|
||||
{
|
||||
"phone_number": notification.octopushPhoneNumber
|
||||
}
|
||||
],
|
||||
"text": msg,
|
||||
"type": notification.octopushSMSType,
|
||||
"purpose": "alert",
|
||||
"sender": notification.octopushSenderName
|
||||
};
|
||||
|
||||
await axios.post(`https://api.octopush.com/v1/public/sms-campaign/send`, data, config)
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
return false;
|
||||
}
|
||||
} else if (notification.type === "slack") {
|
||||
try {
|
||||
if (heartbeatJSON == null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue