From 0275988be2f8e0ec6fa89a852f229162820fb02f Mon Sep 17 00:00:00 2001 From: Celestino Bellone Date: Wed, 22 Nov 2017 17:50:07 +0100 Subject: [PATCH] baseUrl can be also overridden at event level --- src/main/java/alfio/manager/TicketReservationManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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));