From 66460299b443ec3f1f78b78fa503dd2db282a969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adriana=20Ceri=C4=87?= <62163307+AdrianaCeric@users.noreply.github.com> Date: Tue, 28 Nov 2023 13:41:30 -0500 Subject: [PATCH 01/15] feat(TripMonitorNotification): improve trip alert message --- .../middleware/models/TripMonitorNotification.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java index 5ea86804e..6d5fb2f1a 100644 --- a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java +++ b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java @@ -100,7 +100,7 @@ public static TripMonitorNotification createInitialReminderNotification(Monitore TripMonitorNotification notification = new TripMonitorNotification(); notification.type = NotificationType.INITIAL_REMINDER; // TODO: i18n and add itinerary details. - notification.body = String.format("Reminder for your upcoming trip at %s. We will let you know if anything changes.", trip.tripTime); + notification.body = String.format("Reminder for %s at %s.\nWe will notify you if anything changes.", trip.tripName, trip.tripTime); return notification; } @@ -119,15 +119,13 @@ private static String bodyFromAlerts( } // If there are any unseen alerts, include list of these. if (unseenAlerts.size() > 0) { - // TODO: Improve message. - body.append("New alerts found! They are:"); + body.append("\uD83D\uDD14 New alerts found:\n"); body.append(listFromAlerts(unseenAlerts, false)); } // If there are any resolved alerts, include list of these. if (resolvedAlerts.size() > 0) { if (body.length() > 0) body.append("\n"); - // TODO: Improve message. - body.append("Resolved alerts are:"); + body.append("Resolved alerts:"); body.append(listFromAlerts(resolvedAlerts, true)); } return body.toString(); From 77c15cab43db6b6ba14a33a095be0308fbd7d016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adriana=20Ceri=C4=87?= <62163307+AdrianaCeric@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:00:22 -0500 Subject: [PATCH 02/15] fix(TripMonitorNotification): add new line after resolved alerts --- .../middleware/models/TripMonitorNotification.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java index 6d5fb2f1a..dc13ee027 100644 --- a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java +++ b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java @@ -125,7 +125,7 @@ private static String bodyFromAlerts( // If there are any resolved alerts, include list of these. if (resolvedAlerts.size() > 0) { if (body.length() > 0) body.append("\n"); - body.append("Resolved alerts:"); + body.append("Resolved alerts:\n"); body.append(listFromAlerts(resolvedAlerts, true)); } return body.toString(); From d083e447b635671d0002df096210271c1d0434a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adriana=20Ceri=C4=87?= <62163307+AdrianaCeric@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:05:30 -0500 Subject: [PATCH 03/15] fix(TripMonitorNotification): Make initial reminder not a list --- src/main/resources/templates/MonitoredTripHtml.ftl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/resources/templates/MonitoredTripHtml.ftl b/src/main/resources/templates/MonitoredTripHtml.ftl index 1876a405b..7ca412671 100644 --- a/src/main/resources/templates/MonitoredTripHtml.ftl +++ b/src/main/resources/templates/MonitoredTripHtml.ftl @@ -8,11 +8,19 @@ <#macro EmailMain>

Your trip has the following notifications:

+ + <#if notification.type == "INITIAL_REMINDER"> +

${notification.body}

+ + +

View all of your saved trips in ${OTP_UI_NAME}.

From 0a1882c1d4f6a3e459a2034a415f1f49c9aa5b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adriana=20Ceri=C4=87?= <62163307+AdrianaCeric@users.noreply.github.com> Date: Wed, 29 Nov 2023 13:28:43 -0500 Subject: [PATCH 04/15] fix: typo in email template --- src/main/resources/templates/MonitoredTripHtml.ftl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/resources/templates/MonitoredTripHtml.ftl b/src/main/resources/templates/MonitoredTripHtml.ftl index 7ca412671..444e50a6a 100644 --- a/src/main/resources/templates/MonitoredTripHtml.ftl +++ b/src/main/resources/templates/MonitoredTripHtml.ftl @@ -9,9 +9,11 @@

Your trip has the following notifications:

- <#if notification.type == "INITIAL_REMINDER"> -

${notification.body}

- + <#list notifications as notification> + <#if notification.type == "INITIAL_REMINDER"> +

${notification.body}

+ +