mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-09 04:26:43 +02:00
adjust email template for alerts
This commit is contained in:
@@ -41,7 +41,6 @@ export async function fireHealthCheckHealthyAlert(
|
||||
orgId,
|
||||
healthCheckId,
|
||||
data: {
|
||||
healthCheckId,
|
||||
...(healthCheckName != null ? { healthCheckName } : {}),
|
||||
...extra
|
||||
}
|
||||
@@ -87,7 +86,6 @@ export async function fireHealthCheckNotHealthyAlert(
|
||||
orgId,
|
||||
healthCheckId,
|
||||
data: {
|
||||
healthCheckId,
|
||||
...(healthCheckName != null ? { healthCheckName } : {}),
|
||||
...extra
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ export async function fireResourceHealthyAlert(
|
||||
orgId,
|
||||
resourceId,
|
||||
data: {
|
||||
resourceId,
|
||||
...(resourceName != null ? { resourceName } : {}),
|
||||
...extra
|
||||
}
|
||||
@@ -87,7 +86,6 @@ export async function fireResourceUnhealthyAlert(
|
||||
orgId,
|
||||
resourceId,
|
||||
data: {
|
||||
resourceId,
|
||||
...(resourceName != null ? { resourceName } : {}),
|
||||
...extra
|
||||
}
|
||||
@@ -133,7 +131,6 @@ export async function fireResourceToggleAlert(
|
||||
orgId,
|
||||
resourceId,
|
||||
data: {
|
||||
resourceId,
|
||||
...(resourceName != null ? { resourceName } : {}),
|
||||
...extra
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ export async function fireSiteOnlineAlert(
|
||||
orgId,
|
||||
siteId,
|
||||
data: {
|
||||
siteId,
|
||||
...(siteName != null ? { siteName } : {}),
|
||||
...extra
|
||||
}
|
||||
@@ -87,7 +86,6 @@ export async function fireSiteOfflineAlert(
|
||||
orgId,
|
||||
siteId,
|
||||
data: {
|
||||
siteId,
|
||||
...(siteName != null ? { siteName } : {}),
|
||||
...extra
|
||||
}
|
||||
|
||||
@@ -36,13 +36,17 @@ export async function sendAlertEmail(
|
||||
const from = config.getNoReplyEmail();
|
||||
const subject = buildSubject(context);
|
||||
|
||||
const baseUrl = config.getRawConfig().app.dashboard_url!.replace(/\/$/, "");
|
||||
const dashboardLink = `${baseUrl}/${context.orgId}/settings`;
|
||||
|
||||
for (const to of recipients) {
|
||||
try {
|
||||
await sendEmail(
|
||||
AlertNotification({
|
||||
eventType: context.eventType,
|
||||
orgId: context.orgId,
|
||||
data: context.data
|
||||
data: context.data,
|
||||
dashboardLink
|
||||
}),
|
||||
{
|
||||
from,
|
||||
|
||||
Reference in New Issue
Block a user