Skip to content

Commit

Permalink
feat: enhance email body formatting to include record description in …
Browse files Browse the repository at this point in the history
…analytics failure notifications
  • Loading branch information
LeonardoMeireles55 committed Jan 25, 2025
1 parent e2c1751 commit 1d9eee3
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,11 @@ public void sendFailedAnalyticsNotification(List<AnalyticsRecord> failedRecords,

public String generateAnalyticsFailedEmailBody(List<AnalyticsRecord> notPassedList,
String otherValidations) {
String formattedList = notPassedList.stream()
.map(record -> String.format(
"<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td"
+ ">%s</td></tr>",
record.name(), record.level(), record.value().toString(),
record.mean().toString(), record.rules(),
record.date().format(DateTimeFormatter.ofPattern("yyyy-MM-dd " + "HH:mm"))))
String formattedList = notPassedList.stream().map(record -> String.format(
"<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
record.name(), record.level(), record.value().toString(), record.mean().toString(),
record.rules(), record.description(),
record.date().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))))
.collect(Collectors.joining("\n"));
return String.format(HTML_TEMPLATE,
TABLE_STYLE + ANALYTICS_WARNING_HEADER + FAILED_ANALYTICS_HEADER + formattedList
Expand Down

0 comments on commit 1d9eee3

Please sign in to comment.