diff --git a/src/main/java/alfio/manager/TicketReservationManager.java b/src/main/java/alfio/manager/TicketReservationManager.java index a43f1404bf..40cdfa6a6d 100644 --- a/src/main/java/alfio/manager/TicketReservationManager.java +++ b/src/main/java/alfio/manager/TicketReservationManager.java @@ -1131,9 +1131,8 @@ void sendReminderForOfflinePayments() { }); } - //called heach hour + //called each hour void sendReminderForOfflinePaymentsToEventManagers() { - String baseUrl = configurationManager.getRequiredValue(Configuration.getSystemConfiguration(ConfigurationKeys.BASE_URL)); eventRepository.findAllActives(ZonedDateTime.now(Clock.systemUTC())).stream().filter(event -> { ZonedDateTime dateTimeForEvent = ZonedDateTime.now(event.getZoneId()); return dateTimeForEvent.truncatedTo(ChronoUnit.HOURS).getHour() == 5; //only for the events at 5:00 local time @@ -1145,6 +1144,7 @@ void sendReminderForOfflinePaymentsToEventManagers() { Organization organization = organizationRepository.getById(event.getOrganizationId()); List cc = notificationManager.getCCForEventOrganizer(event); String subject = String.format("There are %d pending offline payments that will expire in event: %s", reservations.size(), event.getDisplayName()); + String baseUrl = configurationManager.getRequiredValue(Configuration.from(event.getOrganizationId(), event.getId(), BASE_URL)); Map model = TemplateResource.prepareModelForOfflineReservationExpiringEmailForOrganizer(event, reservations, baseUrl); notificationManager.sendSimpleEmail(event, organization.getEmail(), cc, subject, () -> templateManager.renderTemplate(event, TemplateResource.OFFLINE_RESERVATION_EXPIRING_EMAIL_FOR_ORGANIZER, model, Locale.ENGLISH));