feat: Templating and plaintext for Google Workspace Notification Provider (#6048)

Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
Erik
2025-08-09 19:31:44 +02:00
committed by GitHub
parent f027ce309e
commit 4f944cd869
3 changed files with 50 additions and 1 deletions

View File

@@ -14,6 +14,18 @@ class GoogleChat extends NotificationProvider {
try {
// Google Chat message formatting: https://developers.google.com/chat/api/guides/message-formats/basic
if (notification.googleChatUseTemplate && notification.googleChatTemplate) {
// Send message using template
const renderedText = await this.renderTemplate(
notification.googleChatTemplate,
msg,
monitorJSON,
heartbeatJSON
);
const data = { "text": renderedText };
await axios.post(notification.googleChatWebhookURL, data);
return okMsg;
}
let chatHeader = {
title: "Uptime Kuma Alert",
@@ -88,7 +100,6 @@ class GoogleChat extends NotificationProvider {
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}