@Override public int sendMail(Mail mail) { int result = 0; try { getProtectedPlugin().sendMail(mail, this.context); } catch (Exception e) { // If the exception is a null pointer exception there is no message and e.getMessage() is null. if (e.getMessage() != null) { this.context.put("error", e.getMessage()); } LOGGER.error("Failed to send email [" + mail.toString() + "]", e); result = -1; } return result; }
/** * {@inheritDoc} * * @see MailSender#sendMail(Mail) */ public int sendMail(Mail mail) { int result = 0; try { getProtectedPlugin().sendMail(mail, this.context); } catch (Exception e) { // If the exception is a null pointer exception there is no message and e.getMessage() is null. if (e.getMessage() != null) { this.context.put("error", e.getMessage()); } LOG.error("Failed to send email [" + mail.toString() + "]", e); result = -1; } return result; }
@Override public int sendMail(Mail mail, MailConfiguration mailConfiguration) { int result = 0; try { getProtectedPlugin().sendMail(mail, mailConfiguration, this.context); } catch (Exception e) { // If the exception is a null pointer exception there is no message and e.getMessage() is null. if (e.getMessage() != null) { this.context.put("error", e.getMessage()); } LOGGER.error("Failed to send email [" + mail.toString() + "] using mail configuration [" + mailConfiguration.toString() + "]", e); result = -1; } return result; } }
/** * Send a single Mail * * @param mailItem The Mail to send * @return True if the the email has been sent */ public boolean sendMail(Mail mailItem, XWikiContext context) throws MessagingException, UnsupportedEncodingException { // TODO: Fix the need to instantiate a new XWiki API object com.xpn.xwiki.api.XWiki xwikiApi = new com.xpn.xwiki.api.XWiki(context.getWiki(), context); return sendMail(mailItem, new MailConfiguration(xwikiApi), context); }
/** * Send a single Mail * * @param mailItem The Mail to send * @return True if the the email has been sent */ public boolean sendMail(Mail mailItem, XWikiContext context) throws MessagingException, UnsupportedEncodingException { // TODO: Fix the need to instantiate a new XWiki API object com.xpn.xwiki.api.XWiki xwikiApi = new com.xpn.xwiki.api.XWiki(context.getWiki(), context); return sendMail(mailItem, new MailConfiguration(xwikiApi), context); }
/** * {@inheritDoc} * * @see MailSender#sendMail(Mail, MailConfiguration) */ public int sendMail(Mail mail, MailConfiguration mailConfiguration) { int result = 0; try { getProtectedPlugin().sendMail(mail, mailConfiguration, this.context); } catch (Exception e) { // If the exception is a null pointer exception there is no message and e.getMessage() is null. if (e.getMessage() != null) { this.context.put("error", e.getMessage()); } LOG.error("Failed to send email [" + mail.toString() + "] using mail configuration [" + mailConfiguration.toString() + "]", e); result = -1; } return result; } }
mail.setTextPart((String) options.get(OPTIONS_MESSAGE_FIELD)); mail.setSubject((String) options.get(SUBJECT_FIELD_STRING)); mailsender.sendMail(mail, context); setNotified((String) options.get("patientId"), (String) options.get("matchId")); return 0;
sendMail(mail, context); return 0; } catch (Exception e) {
sendMail(mail, context); return 0; } catch (Exception e) {