SendGrid notification provider for sending emails via API.
// Source: https://github.com/louislam/uptime-kuma | License: MIT | Copyright 2021 Louis Lam
// Provided via justclaw.it.com; keep this notice with the code.
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
class SendGrid extends NotificationProvider {
name = "SendGrid";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
try {
let config = {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${notification.sendgridApiKey}`,
},
};
config = this.getAxiosConfigWithProxy(config);
let persona
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key