Merge branch 'master' into feature/mssql-monitor

This commit is contained in:
Pedro Magno
2026-01-01 01:37:47 +00:00
committed by GitHub
7 changed files with 758 additions and 764 deletions

1414
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,48 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
class Resend extends NotificationProvider {
name = "Resend";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
try {
let config = {
headers: {
Authorization: `Bearer ${notification.resendApiKey}`,
"Content-Type": "application/json",
},
};
config = this.getAxiosConfigWithProxy(config);
const email = notification.resendFromEmail.trim();
const fromName = notification.resendFromName?.trim() || "Uptime Kuma";
let data = {
from: `${fromName} <${email}>`,
to: notification.resendToEmail,
subject: notification.resendSubject || "Notification from Your Uptime Kuma",
// supplied text directly instead of html
text: msg,
};
let result = await axios.post(
"https://api.resend.com/emails",
data,
config
);
if (result.status === 200) {
return okMsg;
} else {
throw new Error(`Unexpected status code: ${result.status}`);
}
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = Resend;

View File

@@ -77,6 +77,7 @@ const Onesender = require("./notification-providers/onesender");
const Wpush = require("./notification-providers/wpush");
const SendGrid = require("./notification-providers/send-grid");
const Brevo = require("./notification-providers/brevo");
const Resend = require("./notification-providers/resend");
const YZJ = require("./notification-providers/yzj");
const SMSPlanet = require("./notification-providers/sms-planet");
const SpugPush = require("./notification-providers/spugpush");
@@ -174,6 +175,7 @@ class Notification {
new Cellsynt(),
new Wpush(),
new Brevo(),
new Resend(),
new YZJ(),
new SMSPlanet(),
new SpugPush(),

View File

@@ -172,6 +172,7 @@ export default {
"Cellsynt": "Cellsynt",
"SendGrid": "SendGrid",
"Brevo": "Brevo",
"Resend": "Resend",
"notifery": "Notifery",
"Webpush": "Webpush",
};

View File

@@ -0,0 +1,48 @@
<template>
<div class="mb-3">
<label for="resend-api-key" class="form-label">{{ $t("resendApiKey") }}</label>
<HiddenInput id="resend-api-key" v-model="$parent.notification.resendApiKey" :required="true" autocomplete="new-password"></HiddenInput>
<i18n-t tag="div" keypath="resendApiHelp" class="form-text">
<a href="https://resend.com/api-keys" target="_blank">https://resend.com/api-keys</a>
</i18n-t>
</div>
<div class="mb-3">
<label for="resend-from-email" class="form-label">{{ $t("resendFromEmail") }}</label>
<input id="resend-from-email" v-model="$parent.notification.resendFromEmail" type="text" class="form-control" required>
</div>
<div class="mb-3">
<label for="resend-from-name" class="form-label">{{ $t("resendFromName") }}</label>
<input id="resend-from-name" v-model="$parent.notification.resendFromName" type="text" class="form-control">
<div class="form-text">{{ $t("resendLeaveBlankForDefaultName") }}</div>
</div>
<div class="mb-3">
<label for="resend-to-email" class="form-label">{{ $t("resendToEmail") }}</label>
<input id="resend-to-email" v-model="$parent.notification.resendToEmail" type="text" class="form-control" required>
</div>
<div class="mb-3">
<label for="resend-subject" class="form-label">{{ $t("resendSubject") }}</label>
<input id="resend-subject" v-model="$parent.notification.resendSubject" type="text" class="form-control">
<small class="form-text text-muted">{{ $t("resendLeaveBlankForDefaultSubject") }}</small>
</div>
<i18n-t tag="p" keypath="More info on:" style="margin-top: 8px;">
<a href="https://resend.com/docs/dashboard/emails/introduction" target="_blank">https://resend.com/docs/dashboard/emails/introduction</a>
</i18n-t>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
mounted() {
if (typeof this.$parent.notification.resendSubject === "undefined") {
this.$parent.notification.resendSubject = "Notification from Your Uptime Kuma";
}
if (typeof this.$parent.notification.resendFromName === "undefined") {
this.$parent.notification.resendFromName = "Uptime Kuma";
}
},
};
</script>

View File

@@ -80,6 +80,7 @@ import YZJ from "./YZJ.vue";
import SMSPlanet from "./SMSPlanet.vue";
import SMSIR from "./SMSIR.vue";
import Webpush from "./Webpush.vue";
import Resend from "./Resend.vue";
/**
* Manage all notification form.
@@ -165,6 +166,7 @@ const NotificationFormList = {
"WPush": WPush,
"SendGrid": SendGrid,
"Brevo": Brevo,
"Resend": Resend,
"YZJ": YZJ,
"SMSPlanet": SMSPlanet,
"Webpush": Webpush,

View File

@@ -1183,6 +1183,13 @@
"brevoSeparateMultipleEmails": "Separate multiple email addresses with commas",
"brevoSubject": "Subject",
"brevoLeaveBlankForDefaultSubject": "leave blank for default subject",
"resendApiKey": "Resend API Key",
"resendApiHelp": "Create an api key here {0}",
"resendFromName": "From Name",
"resendFromEmail": "From Email",
"resendLeaveBlankForDefaultName": "leave blank for default name",
"resendToEmail": "To Email",
"resendSubject": "Subject",
"pingCountLabel": "Max Packets",
"pingCountDescription": "Number of packets to send before stopping",
"pingNumericLabel": "Numeric Output",