Skip to content

Commit

Permalink
baseUrl can be also overridden at event level
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Nov 22, 2017
1 parent a915311 commit 0275988
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/alfio/manager/TicketReservationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -1145,6 +1144,7 @@ void sendReminderForOfflinePaymentsToEventManagers() {
Organization organization = organizationRepository.getById(event.getOrganizationId());
List<String> 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<String, Object> 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));
Expand Down

0 comments on commit 0275988

Please sign in to comment.