feat: issue line break and support markdown

* The issue in the notice is implemented with line break.
* The notification format adopts markdown.
pull/37/head
p0we7 2024-05-30 16:45:07 +00:00 committed by Peter
parent 03d6a5cee9
commit 5ae6443b10
1 changed files with 3 additions and 3 deletions

View File

@ -55,12 +55,12 @@ function formatStatusChangeNotification(
} else if (timeNow == timeIncidentStart) {
return {
title: `🔴 ${monitor.name} is currently down.`,
body: `Service is unavailable at ${timeNowFormatted}. Issue: ${reason || 'unspecified'}`,
body: `Service is unavailable at ${timeNowFormatted}.\n**Issue:** ${reason || 'unspecified'}`,
}
} else {
return {
title: `🔴 ${monitor.name} is still down.`,
body: `Service is unavailable since ${timeIncidentStartFormatted} (${downtimeDuration} minutes). Issue: ${reason || 'unspecified'}`,
body: `Service is unavailable since ${timeIncidentStartFormatted} (${downtimeDuration} minutes).\n**Issue:** ${reason || 'unspecified'}`,
}
}
}
@ -83,7 +83,7 @@ async function notifyWithApprise(
title,
body,
type: 'warning',
format: 'text'
format: 'markdown'
}),
})