-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ceredsms notification provider #5368
base: master
Are you sure you want to change the base?
Conversation
@louislam how can i add translation to file /src/pl.json |
You cannot modify translation files other than the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better, thanks for rebasing.
I have left a few minor comments below.
The most important part is that we still need to have a screenshot of the message getting through (our UI does not count)
<template> | ||
<div class="mb-3"> | ||
<label for="ceredsms-key" class="form-label">{{ $t('API Key') }}</label> | ||
<HiddenInput id="ceredsms-key" v-model="$parent.notification.ceredsmsApiKey" :required="true" autocomplete="new-password"></HiddenInput> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a link to the docs or where users can find this token as a helptext?
</div> | ||
<div class="mb-3"> | ||
<label for="ceredsms-sender-name" class="form-label">{{ $t("Originator") }}</label> | ||
<input id="ceredsms-sender-name" v-model="$parent.notification.ceredsmsSenderName" type="text" minlength="3" maxlength="11" class="form-control"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a helptext where this will be displayed. For SMS this is not quite obvious
* @inheritdoc | ||
*/ | ||
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { | ||
let okMsg = "Sent Successfully."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, was changed for all others
let okMsg = "Sent Successfully."; | |
const okMsg = "Sent Successfully."; |
const axios = require("axios"); | ||
|
||
class CeredSMS extends NotificationProvider { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, was changed for all others
if (resp.data.message) { | ||
let error = `CeredSMS.pl API returned error message: ${resp.data.error.message}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are first checking if message exists and then using error.messsage
Is this intentional?
this.throwGeneralAxiosError(error); | ||
} else { | ||
let error = "CeredSMS.pl API returned an unexpected response"; | ||
this.throwGeneralAxiosError(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing inside the catch does not work as you think it does.
Please throw a regular error here instead.
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]:
Description
Add ceredsms notification provider
Fixes #(issue)
Type of change
Please delete any options that are not relevant.
Checklist
Screenshots (if any)
Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.