Package org.dspace.core

Examples of org.dspace.core.Email


     */
    private void processContactRequester(Request request, RequestItem requestItem) throws IOException, MessagingException {
        String message = request.getParameter("message");
        String subject = request.getParameter("subject");

        Email email = new Email();
        email.setSubject(subject);
        email.setContent("{0}");
        email.addRecipient(requestItem.getReqEmail());
        email.addArgument(message);

        email.send();
    }
View Full Code Here


     */
    private void processContactAuthor(Request request) throws IOException, MessagingException {
        String message = request.getParameter("message");
        String subject = request.getParameter("subject");

        Email email = new Email();
        email.setSubject(subject);
        email.setContent("{0}");
        email.addRecipient(request.getParameter("toEmail"));
        email.addArgument(message);

        email.send();
    }
View Full Code Here

            String siteName = ConfigurationManager.getProperty("dspace.name");

            // All data is there, send the email
            try
            {
                Email email = Email.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "suggest"));
                email.addRecipient(recipAddr);   // recipient address
                email.addArgument(recipName);    // 1st arg - recipient name
                email.addArgument(senderName);   // 2nd arg - sender name
                email.addArgument(siteName);     // 3rd arg - repository name
                email.addArgument(title);        // 4th arg - item title
                email.addArgument(itemUri);      // 5th arg - item handle URI
                email.addArgument(itemUrl);      // 6th arg - item local URL
                email.addArgument(collName);     // 7th arg - collection name
                email.addArgument(message);      // 8th arg - user comments

                // Set sender's address as 'reply-to' address if supplied
                if ( senderAddr != null && ! "".equals(senderAddr))
                {
                  email.setReplyTo(senderAddr);
                }

                // Only actually send the email if feature is enabled
                if (ConfigurationManager.getBooleanProperty("webui.suggest.enable", false))
                {
                    email.send();
                } else
                {
                    throw new MessagingException("Suggest item email not sent - webui.suggest.enable = false");
                }
View Full Code Here

            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);
        }
View Full Code Here

    {
        log.warn("An error occured 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);
        }
View Full Code Here

            return map;
        }

        // All data is there, send the email
        Email email = Email.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "feedback"));
        email.addRecipient(ConfigurationManager
                .getProperty("feedback.recipient"));

        email.addArgument(new Date()); // Date
        email.addArgument(address);    // Email
        email.addArgument(eperson);    // Logged in as
        email.addArgument(page);       // Referring page
        email.addArgument(agent);      // User agent
        email.addArgument(session);    // Session ID
        email.addArgument(comments);   // The feedback itself

        // Replying to feedback will reply to email on form
        email.setReplyTo(address);

        // May generate MessageExceptions.
        email.send();

        // Finished, allow to pass.
        return null;
    }
View Full Code Here

TOP

Related Classes of org.dspace.core.Email

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.