Examples of Mailer


Examples of com.dotmarketing.util.Mailer

      String emails = emailsSB.toString();
      emails = emails.substring(0,emails.lastIndexOf(","));
      File attachment = saveExcelWebFormsToFS(reportType,initialDate,finalDate);

      //Create the Emails and sent it
      Mailer mailer = new Mailer();   
      mailer.setToEmail(emails);
      mailer.setSubject(subject);
      mailer.setFromEmail(fromEmail);
      mailer.setFromName(fromName);

      mailer.addAttachment(attachment);
      mailer.sendMessage();
    }
    catch(Exception ex)
    {
      String message = ex.toString();
      Logger.debug(WebFormFactory.class, message);
View Full Code Here

Examples of com.dotmarketing.util.Mailer

                isHTML = true;
            } else {
                emailText = VelocityUtil.eval(emailText, ctx);
            }
            for(String x: email){
                Mailer mail = new Mailer();
                mail.setFromEmail(emailFrom);
                mail.setFromName(emailFromFullName);
                mail.setToEmail(x);
                mail.setSubject(VelocityUtil.eval(subject, ctx));
                if (isHTML) {
                    mail.setHTMLAndTextBody(emailText);
                } else {
                    mail.setTextBody(emailText);
                }
                mail.sendMessage();
            }
        } catch (Exception e) {
            throw new DotWorkflowException("Exception ocurred trying to deliver emails for workflow " + e.getMessage());
        }
View Full Code Here

Examples of com.feth.play.module.mail.Mailer

            final String email = filledForm.get().email;
            final Body body = new Body(
                    views.txt.email.body.render().toString(),
                    views.html.email.body.render().toString()
            );
            final Mailer defaultMailer = Mailer.getDefaultMailer();

            {
                // simple usage
                defaultMailer.sendMail("play-easymail | it works!", body, email);
            }

            {
                // advanced usage
                final Mailer.Mail customMail = new Mailer.Mail("play-easymail | advanced", body, new String[]{ email });
                customMail.addCustomHeader("Reply-To", email);
                customMail.addAttachment(new Attachment("attachment.pdf", Play.application().getFile("conf/sample.pdf")));
                byte[] data = "data".getBytes();
                customMail.addAttachment(new Attachment("data.txt", data, "text/plain", "A simple file", EmailAttachment.INLINE));
                defaultMailer.sendMail(customMail);
            }

            flash("message", "2 mails to '" + email + "' have been sent successfully!");
            return redirect(routes.Application.index());
        }
View Full Code Here

Examples of com.jada.util.Mailer

            return actionForward;
        }
        Customer customer = (Customer) list.get(0);
       
         MessageResources resources = this.getResources(request);
        Mailer mailer = new Mailer(site);
        SiteDomain siteDomain = contentBean.getContentSessionBean().getSiteDomain();
        SiteDomainLanguage siteDomainLanguage = null;
        for (SiteDomainLanguage language : siteDomain.getSiteDomainLanguages()) {
          if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
            siteDomainLanguage = language;
            break;
         
        }
        SiteDomainParamBean siteDomainParamBean = SiteDomainDAO.getSiteDomainParamBean(siteDomain.getSiteDomainLanguage(), siteDomainLanguage);
        String mailFrom = siteDomainParamBean.getMailFromPwdReset();
        String subject = siteDomainParamBean.getSubjectPwdReset();
        String body = resources.getMessage("message.mail.pwdReset.body", AESEncoder.getInstance().decode(customer.getCustPassword()));
        if (mailFrom == null) {
          mailFrom = "";
        }
        if (subject == null) {
          subject = "";
        }
       
        try {
          mailer.sendMail(mailFrom, form.getCustEmail(), subject, body);
        }
        catch (MessagingException e) {
          messages.add("forgot", new ActionMessage("content.error.mail.send"));
      saveMessages(request, messages);
            ActionForward actionForward = actionMapping.findForward("error");
View Full Code Here

Examples of com.jada.util.Mailer

        String value = (String) request.getParameter(name);
        content += name + ": " + value + "\n";
      }
     
      MessageResources resources = this.getResources(request);
        Mailer mailer = new Mailer(site);
        ContentBean contentBean = getContentBean(request);
      SiteDomainLanguage siteDomainLanguage = null;
      for (SiteDomainLanguage language : contentBean.getContentSessionBean().getSiteDomain().getSiteDomainLanguages()) {
        if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
          siteDomainLanguage = language;
          break;
        }
      }
      SiteDomainParamBean siteDomainParamBean = SiteDomainDAO.getSiteDomainParamBean(contentBean.getContentSessionBean().getSiteDomain().getSiteDomainLanguage(), siteDomainLanguage);
        String mailFrom = siteDomainParamBean.getMailFromContactUs();
    ContentSessionBean contentSessionBean = contentBean.getContentSessionBean();
        if (email == null) {
          logger.error("email address value is null and email may not be sent");
            ActionForward forward = actionMapping.findForward("error") ;
            forward = new ActionForward(forward.getPath() +
                      contentSessionBean.getSiteDomain().getSiteDomainPrefix() + "/" +
                          contentSessionBean.getSiteProfile().getSiteProfileClass().getSiteProfileClassName() + "/" +
                          "contactus?message=content.text.contactUs.error",
                          forward.getRedirect());
            return forward;
        }
        String subject = resources.getMessage("content.text.contactUs");
logger.error("mailFrom > " + mailFrom);
logger.error("email > " + email);
logger.error("subject > " + subject);
logger.error("content > " + content);
        mailer.sendMail(mailFrom, email, subject, content);
       
        ActionForward forward = actionMapping.findForward("success") ;
        forward = new ActionForward(forward.getPath() +
                  contentSessionBean.getSiteDomain().getSiteDomainPrefix() + "/" +
                      contentSessionBean.getSiteProfile().getSiteProfileClass().getSiteProfileClassName() + "/" +
View Full Code Here

Examples of com.jada.util.Mailer

    TemplateEngine engine = TemplateEngine.getInstance();
    engine.init(request, servletContext, true);
    engine.setParameter("orderHeaderId", orderHeader.getOrderHeaderId());
    String body = engine.mergeData("mail/custSaleConfirmation.vm", "template", engine);
        Mailer mailer = new Mailer(site);

        String mailFrom = siteDomainParamBean.getMailFromCustSales();
        String subject = siteDomainParamBean.getSubjectCustSales();
        String mailTo = orderHeader.getCustEmail();
        if (mailFrom == null) {
          mailFrom = "";
        }
        if (subject == null) {
          subject = "";
        }
        if (Format.isNullOrEmpty(mailFrom) || Format.isNullOrEmpty(mailTo)) {
          logger.error("Unable to send customer sales email");
          logger.error("mailFrom = " + mailFrom);
          logger.error("mailTo = " + mailTo);
          logger.error("subject = " + subject);
        }
        mailer.sendMail(mailFrom, mailTo, subject, body, "text/html");
       
    body = engine.mergeData("mail/adminSaleNotification.vm", "template", engine);
    mailTo = siteDomainParamBean.getCheckoutNotificationEmail();
        mailFrom = siteDomainParamBean.getMailFromNotification();
        subject = siteDomainParamBean.getSubjectNotification();
        if (!Format.isNullOrEmpty(mailFrom) && !Format.isNullOrEmpty(mailTo)) {
          mailer.sendMail(mailFrom, mailTo, subject, body, "text/html");
        }
  }
View Full Code Here

Examples of com.jada.util.Mailer

          orderHeader.getSiteProfile(),
          orderHeader.getSiteCurrency(),
          servletContext);
    engine.setParameter("orderHeaderId", orderHeader.getOrderHeaderId());
    String body = engine.mergeData("mail/shippingQuote.vm", "template", engine);
        Mailer mailer = new Mailer(site);

        String mailFrom = siteDomainParamBean.getMailFromShippingQuote();
        String subject = siteDomainParamBean.getSubjectShippingQuote();
        String mailTo = orderHeader.getCustEmail();
        if (mailFrom == null) {
          mailFrom = "";
        }
        if (subject == null) {
          subject = "";
        }
        if (Format.isNullOrEmpty(mailFrom) || Format.isNullOrEmpty(mailTo)) {
          logger.error("Unable to send customer sales email");
          logger.error("mailFrom = " + mailFrom);
          logger.error("mailTo = " + mailTo);
          logger.error("subject = " + subject);
        }
        mailer.sendMail(mailFrom, mailTo, subject, body, "text/html");
  }
View Full Code Here

Examples of gov.nysenate.util.Mailer

    {
        try
        {
            appInstance.config = new Config(propertyFileName);
            appInstance.db = new DB(appInstance.config, "mysqldb");
            appInstance.mailer = new Mailer(appInstance.config, "mailer");
            appInstance.environment = new Environment(appInstance.config, "env");
            appInstance.lucene = new Lucene(new File(appInstance.config.getValue("lucene.directory")), luceneReadOnly);
            appInstance.storage = new Storage(appInstance.environment.getStorageDirectory());
            return true;
        }
View Full Code Here

Examples of hudson.tasks.Mailer

    configureDefaultSonar();
    // Configure Mailer and Mailbox
    JenkinsLocationConfiguration.get().setAdminAddress("admin@example.org");
    String recipient = "me@example.org";
    inbox = Mailbox.get(recipient);
    mailer = new Mailer();
    mailer.recipients = "me@example.org";
  }
View Full Code Here

Examples of hudson.tasks.Mailer

        prepareJob();

        DescribableList<Publisher, Descriptor<Publisher>> list
            = new DescribableList<Publisher, Descriptor<Publisher>>();

        list.add(new Mailer());

        Map<String, ExternalProjectProperty<Publisher>> map = DescribableListUtil.convertToProjectProperties(list, job);
        assertNotNull(map);
        assertEquals(map.size(), 1);
        assertNotNull(map.get(mailerName));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.