Repository: louislam/uptime-kuma
File: server/notification-providers/zoho-cliq.js (JavaScript)

Code before:
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");

class ZohoCliq extends NotificationProvider {
    name = "ZohoCliq";

    /**
     * Generate the message to send
     * @param {const} status The status constant
     * @param {string} monitorName Name of monitor
     * @returns {string} Status message
     */
    _statusMessageFactory = (status, monitorName) => {
        if (status === DOWN) {
            return `🔴 [${monitorName}] went down\n`;
        } else if (status === UP) {
            return `✅ [${monitorName}] is back online\n`;
        }
        return "Notification\n";
    };

    /**
     * Send the notification
     * @param {string} webhookUrl URL to send the request to
     * @param {Array} payload Payload generated by _notificationPayloadFactory
     * @returns {Promise<void>}
     */
    _sendNotification = async (webhookUrl, payload) => {
        await axios.post(webhookUrl, { text: payload.join("\n") });
    };

    /**
     * Generate payload for notification
     * @param {object} args Method arguments
     * @param {const} args.status The status of the monitor
     * @param {string} args.monitorMessage Message to send
     * @param {string} args.monitorName Name of monitor affected
     * @param {string} args.monitorUrl URL of monitor affected
     * @returns {Array} Notification payload
     */
    _notificationPayloadFactory = ({
        status,

Review comment (suggestion):
Let's make this into the headline instead of the previous (now removed) Uptime Kuma headline.
Think we can improve the visual hierarchy this way.

Could you test if the following looks better?

```suggestion
            return `### ✅ [${monitorName}] is back online\n`;
```


Code after:
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");

class ZohoCliq extends NotificationProvider {
    name = "ZohoCliq";

    /**
     * Generate the message to send
     * @param {const} status The status constant
     * @param {string} monitorName Name of monitor
     * @returns {string} Status message
     */
    _statusMessageFactory = (status, monitorName) => {
        if (status === DOWN) {
            return `🔴 [${monitorName}] went down\n`;
        } else if (status === UP) {
            return `### ✅ [${monitorName}] is back online\n`;
        }
        return "Notification\n";
    };

    /**
     * Send the notification
     * @param {string} webhookUrl URL to send the request to
     * @param {Array} payload Payload generated by _notificationPayloadFactory
     * @returns {Promise<void>}
     */
    _sendNotification = async (webhookUrl, payload) => {
        await axios.post(webhookUrl, { text: payload.join("\n") });
    };

    /**
     * Generate payload for notification
     * @param {object} args Method arguments
     * @param {const} args.status The status of the monitor
     * @param {string} args.monitorMessage Message to send
     * @param {string} args.monitorName Name of monitor affected
     * @param {string} args.monitorUrl URL of monitor affected
     * @returns {Array} Notification payload
     */
    _notificationPayloadFactory = ({
        status,