diff --git a/go-app/internal/cmc/handlers/quotes/quotes.go b/go-app/internal/cmc/handlers/quotes/quotes.go index 595cdc1b..51299020 100644 --- a/go-app/internal/cmc/handlers/quotes/quotes.go +++ b/go-app/internal/cmc/handlers/quotes/quotes.go @@ -292,7 +292,9 @@ func (h *QuotesHandler) DailyQuoteExpirationCheck() { fmt.Println("Running DailyQuoteExpirationCheck...") reminderJobs := []quoteReminderJob{ + {5, FirstReminder, "Reminder: Quote %s Expires Soon", "first_reminder.html"}, // FOR TESTING {7, FirstReminder, "Reminder: Quote %s Expires Soon", "first_reminder.html"}, + {-3, SecondReminder, "Follow-Up: Quote %s Expired", "second_reminder.html"}, // FOR TESTING {-7, SecondReminder, "Follow-Up: Quote %s Expired", "second_reminder.html"}, {-60, ThirdReminder, "Final Reminder: Quote %s Closed", "final_reminder.html"}, } @@ -303,6 +305,11 @@ func (h *QuotesHandler) DailyQuoteExpirationCheck() { fmt.Printf("Error getting quotes for day offset %d: %v\n", job.DayOffset, err) continue } + + if len(quotes) == 0 { + fmt.Printf("No %s emails to send for day offset %d.\n", job.ReminderType.String(), job.DayOffset) + continue + } for _, q := range quotes { // Format dates as DD/MM/YYYY var submissionDate, expiryDate string diff --git a/go-app/server b/go-app/server index b0db0749..570b4c0b 100755 Binary files a/go-app/server and b/go-app/server differ