const NotificationProvider = require("./notification-provider"); const axios = require("axios"); class Brevo extends NotificationProvider { name = "Brevo"; /** * @inheritdoc */ async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; try { let config = { headers: { "Accept": "application/json", "Content-Type": "application/json", "api-key": notification.brevoApiKey, }, }; let to = [{ email: notification.brevoToEmail }]; let data = { sender: { email: notification.brevoFromEmail.trim(), name: notification.brevoFromName || "Uptime Kuma" }, to: to, subject: notification.brevoSubject || "Notification from Your Uptime Kuma", htmlContent: `
${msg.replace(/\n/g, "
")}