Email email = Email.getEmail(I18nUtil.getEmailFilename(Locale.getDefault(), "harvesting_error")); email.addRecipient(recipient); email.addArgument(targetCollection.getID()); email.addArgument(new Date()); email.addArgument(status); email.addArgument(ex.getMessage()); email.addArgument(stackTrace); email.send();
private void sendAlertMail(String action, DSpaceObject dso, String doi, String reason) throws IOException { String recipient = ConfigurationManager.getProperty("alert.recipient"); try { if (recipient != null) { Email email = Email.getEmail( I18nUtil.getEmailFilename(Locale.getDefault(), "doi_maintenance_error")); email.addRecipient(recipient); email.addArgument(action); email.addArgument(new Date()); email.addArgument(ContentServiceFactory.getInstance().getDSpaceObjectService(dso).getTypeText(dso)); email.addArgument(dso.getID().toString()); email.addArgument(doi); email.addArgument(reason); email.send(); if (!quiet) { System.err.println("Email alert is sent."); } } } catch (Exception e) { LOG.warn("Unable to send email alert", e); if (!quiet) { System.err.println("Unable to send email alert."); } } }
Locale.getDefault(), "internal_error")); email.addRecipient(recipient); email.addArgument(ConfigurationManager .getProperty("dspace.url")); email.addArgument(new Date()); email.addArgument(stackTrace); email.send();
Locale.getDefault(), "internal_error")); email.addRecipient(recipient); email.addArgument(ConfigurationManager .getProperty("dspace.url")); email.addArgument(new Date()); email.addArgument(stackTrace); email.send();
email.addArgument(ConfigurationManager .getProperty("dspace.url")); email.addArgument(new Date()); email.addArgument(request.getSession().getId()); email.addArgument(logInfo); email.addArgument(stackTrace); email.send();
@Override public void emailErrorMessage(EPerson eperson, String error) throws MessagingException { log.warn("An error occurred during item import, the user will be notified. " + error); try { Locale supportedLocale = I18nUtil.getEPersonLocale(eperson); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "bte_batch_import_error")); email.addRecipient(eperson.getEmail()); email.addArgument(error); email.addArgument(ConfigurationManager.getProperty("dspace.url") + "/feedback"); email.send(); } catch (Exception e) { log.warn("error during item import error notification", e); } }
@Override public void emailErrorMessage(EPerson eperson, String error) throws MessagingException { log.warn("An error occurred during item export, the user will be notified. " + error); try { Locale supportedLocale = I18nUtil.getEPersonLocale(eperson); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "export_error")); email.addRecipient(eperson.getEmail()); email.addArgument(error); email.addArgument(ConfigurationManager.getProperty("dspace.url") + "/feedback"); email.send(); } catch (Exception e) { log.warn("error during item export error notification", e); } }
email.addArgument(ConfigurationManager .getProperty("dspace.url")); email.addArgument(new Date()); email.addArgument(request.getSession().getId()); email.addArgument(logInfo); email.addArgument(stackTrace); try email.addArgument(user.getFullName() + " (" + user.getEmail() + ")"); email.addArgument("Anonymous"); email.addArgument(request.getRemoteAddr()); email.send();
@Override public void notifyOfCuration(Context c, BasicWorkflowItem wi, List<EPerson> ePeople, String taskName, String action, String message) throws SQLException, IOException { try { // Get the item title String title = getItemTitle(wi); // Get the submitter's name String submitter = getSubmitterName(wi); // Get the collection Collection coll = wi.getCollection(); for (EPerson epa : ePeople) { Locale supportedLocale = I18nUtil.getEPersonLocale(epa); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "flowtask_notify")); email.addArgument(title); email.addArgument(coll.getName()); email.addArgument(submitter); email.addArgument(taskName); email.addArgument(message); email.addArgument(action); email.addRecipient(epa.getEmail()); email.send(); } } catch (MessagingException e) { log.warn(LogManager.getHeader(c, "notifyOfCuration", "cannot email users of workflow_item_id " + wi.getID() + ": " + e.getMessage())); } }
: "change_password")); bean.addRecipient(email); bean.addArgument(specialLink); bean.send();
@Override public void emailSuccessMessage(Context context, EPerson eperson, String fileName) throws MessagingException { try { Locale supportedLocale = I18nUtil.getEPersonLocale(eperson); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "export_success")); email.addRecipient(eperson.getEmail()); email.addArgument(ConfigurationManager.getProperty("dspace.url") + "/exportdownload/" + fileName); email.addArgument(ConfigurationManager.getProperty("org.dspace.app.itemexport.life.span.hours")); email.send(); } catch (Exception e) { log.warn(LogManager.getHeader(context, "emailSuccessMessage", "cannot notify user of export"), e); } }
Email email = Email.getEmail(email_path); email.addRecipient(to); email.addArgument(r.toString()); email.send(); } catch (Exception e) {
Locale supportedLocale = I18nUtil.getEPersonLocale(anEpa); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "submit_task")); email.addArgument(title); email.addArgument(coll.getName()); email.addArgument(submitter); break; email.addArgument(message); email.addArgument(getMyDSpaceLink()); email.addRecipient(anEpa.getEmail()); email.send();
protected void notifyOfReject(Context c, XmlWorkflowItem wi, EPerson e, String reason) { try { // Get the item title String title = wi.getItem().getName(); // Get the collection Collection coll = wi.getCollection(); // Get rejector's name String rejector = getEPersonName(e); Locale supportedLocale = I18nUtil.getEPersonLocale(e); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "submit_reject")); email.addRecipient(wi.getSubmitter().getEmail()); email.addArgument(title); email.addArgument(coll.getName()); email.addArgument(rejector); email.addArgument(reason); email.addArgument(ConfigurationManager.getProperty("dspace.url") + "/mydspace"); email.send(); } catch (Exception ex) { // log this email error log.warn(LogManager.getHeader(c, "notify_of_reject", "cannot email user" + " eperson_id" + e.getID() + " eperson_email" + e.getEmail() + " workflow_item_id" + wi.getID())); } }
@Override public void emailSuccessMessage(Context context, EPerson eperson, String fileName) throws MessagingException { try { Locale supportedLocale = I18nUtil.getEPersonLocale(eperson); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "bte_batch_import_success")); email.addRecipient(eperson.getEmail()); email.addArgument(fileName); email.send(); } catch (Exception e) { log.warn(LogManager.getHeader(context, "emailSuccessMessage", "cannot notify user of import"), e); } }
email.addArgument(title); email.addArgument(coll.getName()); email.addArgument(rejector); email.addArgument(reason); email.addArgument(getMyDSpaceLink());
adminEmail.addRecipient(notifyRecipient); adminEmail.addArgument(ConfigurationManager.getProperty("dspace.name")); adminEmail.addArgument(ConfigurationManager.getProperty("dspace.url")); adminEmail.addArgument(eperson.getFirstName() + " " + eperson.getLastName()); // Name adminEmail.addArgument(eperson.getEmail()); adminEmail.addArgument(new Date());
email.addArgument(title); email.addArgument(coll.getName()); email.addArgument(handleService.getCanonicalForm(handle));
@Override public void alertUsersOnTaskActivation(Context c, XmlWorkflowItem wfi, String emailTemplate, List<EPerson> epa, String... arguments) throws IOException, SQLException, MessagingException { if (noEMail.containsKey(wfi.getItem().getID())) { // suppress email, and delete key noEMail.remove(wfi.getItem().getID()); } else { Email mail = Email.getEmail(I18nUtil.getEmailFilename(c.getCurrentLocale(), emailTemplate)); for (String argument : arguments) { mail.addArgument(argument); } for (EPerson anEpa : epa) { mail.addRecipient(anEpa.getEmail()); } mail.send(); } }
email.addArgument(title); email.addArgument(coll.getName()); email.addArgument(handleService.getCanonicalForm(handle));