public String getEmail() { return principal.getEmail(); }
} else { NuxeoPrincipal currentUser = (NuxeoPrincipal) FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal(); fromEmail = currentUser.getEmail(); List<NuxeoPrincipal> listEmails = new ArrayList<NuxeoPrincipal>(); for (String user : principalListManager.getSelectedUsers()) {
return; String email = recepient.getEmail(); if (email == null || "".equals(email)) { log.error("No email found for user: " + userDest);
@Override public void sendNotification(String notificationName, Map<String, Object> infoMap, String userPrincipal) { Notification notif = getNotificationByName(notificationName); NuxeoPrincipal recipient = NotificationServiceHelper.getUsersService().getPrincipal(userPrincipal); String email = recipient.getEmail(); String mailTemplate = notif.getTemplate(); infoMap.put("mail.to", email); String authorUsername = (String) infoMap.get("author"); if (authorUsername != null) { NuxeoPrincipal author = NotificationServiceHelper.getUsersService().getPrincipal(authorUsername); infoMap.put("principalAuthor", author); } // mail.put("doc", docMessage); - should be already there String subject = notif.getSubject() == null ? "Alert" : notif.getSubject(); if (notif.getSubjectTemplate() != null) { subject = notif.getSubjectTemplate(); } subject = NotificationServiceHelper.getNotificationService().getEMailSubjectPrefix() + " " + subject; infoMap.put("subject", subject); infoMap.put("template", mailTemplate); try { emailHelper.sendmail(infoMap); } catch (MessagingException e) { throw new NuxeoException("Failed to send notification email ", e); } }