Adding in some testing quote checks and logging"

"
This commit is contained in:
Finley Ghosh 2025-08-11 15:48:12 +10:00
parent eea4853a0f
commit b44cbb68d9
2 changed files with 7 additions and 0 deletions

View file

@ -292,7 +292,9 @@ func (h *QuotesHandler) DailyQuoteExpirationCheck() {
fmt.Println("Running DailyQuoteExpirationCheck...") fmt.Println("Running DailyQuoteExpirationCheck...")
reminderJobs := []quoteReminderJob{ reminderJobs := []quoteReminderJob{
{5, FirstReminder, "Reminder: Quote %s Expires Soon", "first_reminder.html"}, // FOR TESTING
{7, FirstReminder, "Reminder: Quote %s Expires Soon", "first_reminder.html"}, {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"}, {-7, SecondReminder, "Follow-Up: Quote %s Expired", "second_reminder.html"},
{-60, ThirdReminder, "Final Reminder: Quote %s Closed", "final_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) fmt.Printf("Error getting quotes for day offset %d: %v\n", job.DayOffset, err)
continue 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 { for _, q := range quotes {
// Format dates as DD/MM/YYYY // Format dates as DD/MM/YYYY
var submissionDate, expiryDate string var submissionDate, expiryDate string

Binary file not shown.