Ejemplo n.º 1
0
 private Object[] getDetailBody(HttpServletRequest request, Booking booking) {
   return new Object[] {
     booking.getPlayer().toString(),
     FormatUtils.DATE_HUMAN_READABLE.print(booking.getBookingDate()),
     FormatUtils.TIME_HUMAN_READABLE.print(booking.getBookingTime()),
     booking.getName(),
     msg.get(booking.getPaymentMethod().toString()),
     booking.getAmount(),
     booking.getCurrency(),
     RequestUtil.getBaseURL(request) + "/invoices/booking/" + booking.getUUID(),
     RequestUtil.getBaseURL(request) + "/admin/reports/booking/" + booking.getId()
   };
 }
Ejemplo n.º 2
0
 public void sendNewBookingNotification(HttpServletRequest request, Booking booking)
     throws MailException, IOException {
   List<Contact> contactsToNotifyOnBooking = contactDAO.findAllForBookings();
   if (!contactsToNotifyOnBooking.isEmpty()) {
     Mail mail = new Mail();
     mail.setSubject(
         msg.get(
             "BookingSuccessfulMailSubjectAdmin",
             new Object[] {
               FormatUtils.DATE_HUMAN_READABLE.print(booking.getBookingDate()),
               FormatUtils.TIME_HUMAN_READABLE.print(booking.getBookingTime()),
               booking.getPlayer().toString()
             }));
     mail.setBody(msg.get("BookingSuccessfulMailBodyAdmin", getDetailBody(request, booking)));
     mail.setRecipients(contactsToNotifyOnBooking);
     mailUtils.send(mail, request);
   }
 }