コード例 #1
0
ファイル: BookingUtil.java プロジェクト: debueb/padel.koeln
 public void sendBookingConfirmation(HttpServletRequest request, Booking booking)
     throws MailException, IOException {
   Mail mail = new Mail();
   mail.setSubject(msg.get("BookingSuccessfulMailSubject"));
   mail.setBody(
       msg.get(
           "BookingSuccessfulMailBody",
           new Object[] {
             booking.getPlayer().toString(),
             FormatUtils.DATE_MEDIUM.print(booking.getBookingDate()),
             FormatUtils.TIME_HUMAN_READABLE.print(booking.getBookingTime()),
             booking.getName(),
             msg.get(booking.getPaymentMethod().toString()),
             booking.getAmount(),
             booking.getCurrency(),
             CANCELLATION_POLICY_DEADLINE,
             RequestUtil.getBaseURL(request)
                 + "/bookings/booking/"
                 + booking.getUUID()
                 + "/cancel",
             RequestUtil.getBaseURL(request) + "/invoices/booking/" + booking.getUUID(),
             RequestUtil.getBaseURL(request)
           }));
   mail.addRecipient(booking.getPlayer());
   mailUtils.send(mail, request);
 }
コード例 #2
0
ファイル: BookingUtil.java プロジェクト: debueb/padel.koeln
 public void sendBookingCancellationNotification(HttpServletRequest request, Booking booking)
     throws MailException, IOException {
   List<Contact> contactsToNotifyOnBookingCancellation =
       contactDAO.findAllForBookingCancellations();
   if (!contactsToNotifyOnBookingCancellation.isEmpty()) {
     Mail mail = new Mail();
     mail.setSubject(
         msg.get(
             "BookingCancelledAdminMailSubject",
             new Object[] {
               FormatUtils.DATE_HUMAN_READABLE.print(booking.getBookingDate()),
               FormatUtils.TIME_HUMAN_READABLE.print(booking.getBookingTime()),
               booking.getPlayer().toString()
             }));
     mail.setBody(msg.get("BookingCancelledAdminMailBody", getDetailBody(request, booking)));
     mail.addRecipient(booking.getPlayer());
     mailUtils.send(mail, request);
   }
 }
コード例 #3
0
ファイル: BookingUtil.java プロジェクト: debueb/padel.koeln
 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()
   };
 }