Examples of MailTemplate


Examples of com.agiletec.plugins.jpwtt.aps.system.services.ticket.alerter.mail.model.MailTemplate

    config.setSubject(mailElem.getChildText(MAIL_SUBJECT_CHILD));
   
    Element templatesElem = mailElem.getChild(MAIL_TEMPLATES_CHILD);
    List<Element> templates = templatesElem.getChildren(MAIL_TEMPLATE_CHILD);
    for (Element templateElem : templates) {
      MailTemplate template = new MailTemplate();
      String operationString = templateElem.getAttributeValue(MAIL_TEMPLATE_OPERATION_ATTR);
      Integer operation = Integer.valueOf(operationString);
      template.setOperation(operationString);
      List<Element> bodyElements = templateElem.getChildren(MAIL_TEMPLATE_BODY_CHILD);
      for (Element bodyElement : bodyElements) {
        String type = bodyElement.getAttributeValue(MAIL_TEMPLATE_BODY_TYPE_ATTR);
        String body = bodyElement.getText();
        template.addTemplateBody(type, body);
      }
      config.addTemplate(operation, template);
    }
  }
View Full Code Here

Examples of com.agiletec.plugins.jpwtt.aps.system.services.ticket.alerter.mail.model.MailTemplate

    thread.startTicketOperationThread(this, ticket, operation, interventionType, threadName);
  }
 
  @Override
  public void sendAlertOnAddedTicket(Ticket ticket, InterventionType interventionType) {
    MailTemplate template = this.getConfig().getTemplates().get(new Integer(0));
    try {
      this.sendAlert(ticket, null, interventionType, template);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "sendAlertOnAddedTicket");
    }
View Full Code Here

Examples of com.agiletec.plugins.jpwtt.aps.system.services.ticket.alerter.mail.model.MailTemplate

  }
 
  @Override
  public void sendAlertOnTicketOperation(Ticket ticket, TicketOperation operation, InterventionType interventionType) {
    Integer operationCode = new Integer(operation.getOperationCode());
    MailTemplate template = this.getConfig().getTemplates().get(operationCode);
    try {
      this.sendAlert(ticket, operation, interventionType, template);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "sendAlertOnTicketOperation");
    }
View Full Code Here

Examples of com.day.cq.commons.mail.MailTemplate

        emailTemplatePath = this.getClass().getResource("/emailTemplate.txt").getFile().toString();

        // Mock the Mail Template
        PowerMockito.mockStatic(MailTemplate.class);
        when(MailTemplate.create(emailTemplatePath, session)).thenReturn(
            new MailTemplate(new FileInputStream(emailTemplatePath), "UTF-8"));
    }
View Full Code Here

Examples of com.day.cq.commons.mail.MailTemplate

    private Email getEmail(String templatePath, Map<String, String> emailParams) {
        ResourceResolver resourceResolver = null;
        try {
            resourceResolver = resourceResolverFactory.getAdministrativeResourceResolver(null);

           final MailTemplate mailTemplate = MailTemplate.create(templatePath, resourceResolver.adaptTo(Session.class));

           if (mailTemplate == null) {
               log.warn("Email template at {} could not be created.", templatePath);
               return null;
           }

           Class<? extends Email> emailClass = templatePath.endsWith(".html") ? HtmlEmail.class : SimpleEmail.class;

           final Email email = mailTemplate.getEmail(StrLookup.mapLookup(emailParams), emailClass);

           if (emailParams.containsKey(EmailServiceConstants.SENDER_EMAIL_ADDRESS)
                    && emailParams.containsKey(EmailServiceConstants.SENDER_NAME)) {
                email.setFrom(emailParams.get(EmailServiceConstants.SENDER_EMAIL_ADDRESS),
                        emailParams.get(EmailServiceConstants.SENDER_NAME));
View Full Code Here

Examples of com.will.mail.MailTemplate

    log.warning("user:"+user);
    log.warning("passwd:"+passwd);
    throw new RuntimeException("authentication failed");
      }
      updateProperties(request, user);
      mailService.sendMail(new MailTemplate());
  }
View Full Code Here

Examples of com.will.mail.MailTemplate

      c.setUpdateBy(user+"@"+request.getRemoteAddr());

//       service=new DataStoreService();
      dataService.saveConfig(c);

      mailService.sendMail(new MailTemplate());

//      getServletContext().setAttribute("redirectURL", url);
//      Constants.REDIRECT_URL=url;
      System.out.println("new config:"+c);
      PrintWriter out = response.getWriter();
View Full Code Here

Examples of org.blueoxygen.postila.partnerrelations.entity.MailTemplate

    }
    if(hasErrors()){
      return INPUT;
    }
   
    MailTemplate mailTemplate;
    if(getMailTemplate().getId() == null || "".equalsIgnoreCase(getMailTemplate().getId())){
      mailTemplate = new MailTemplate();
      logInfo = new LogInformation();
      logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
      logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
    } else {
      mailTemplate = (MailTemplate) manager.getById(MailTemplate.class, getMailTemplate().getId());
      logInfo = mailTemplate.getLogInformation();
    }

    logInfo.setActiveFlag(getActive());
    logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
    logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
   
    mailTemplate.setLogInformation(logInfo);
    mailTemplate.setName(getMailTemplate().getName());
    mailTemplate.setSubject(getMailTemplate().getSubject());
    mailTemplate.setMailText1(getMailTemplate().getMailText1());
    mailTemplate.setMailText2(getMailTemplate().getMailText2());
    mailTemplate.setMailText3(getMailTemplate().getMailText3());
    mailTemplate.setHTML(getMailTemplate().getHTML());
 
    manager.save(mailTemplate);
    setMailTemplate(mailTemplate);
   
    return SUCCESS;
View Full Code Here

Examples of org.jbpm.pvm.internal.email.impl.MailTemplate

      templateRegistry = new MailTemplateRegistry();
      templateRegistryDescriptor = new ProvidedObjectDescriptor(templateRegistry, true);
    }

    // create the mail template and add it to the registry
    MailTemplate mailTemplate = parseMailTemplate(element, parse);
    String templateName = XmlUtil.attribute(element, "name", true, parse);
    templateRegistry.addTemplate(templateName, mailTemplate);

    return templateRegistryDescriptor;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.email.impl.MailTemplate

    return templateRegistryDescriptor;
  }

  public static MailTemplate parseMailTemplate(Element element, Parse parse) {
    MailTemplate mailTemplate = new MailTemplate();
    mailTemplate.setLanguage(XmlUtil.attribute(element, "language"));

    mailTemplate.setFrom(parseRecipientTemplate(element, "from", parse));
    mailTemplate.setTo(parseRecipientTemplate(element, "to", parse));
    mailTemplate.setCc(parseRecipientTemplate(element, "cc", parse));
    mailTemplate.setBcc(parseRecipientTemplate(element, "bcc", parse));

    Element subjectElement = XmlUtil.element(element, "subject");
    if (subjectElement != null) {
      mailTemplate.setSubject(XmlUtil.getContentText(subjectElement));
    }

    Element textElement = XmlUtil.element(element, "text");
    if (textElement != null) {
      mailTemplate.setText(XmlUtil.getContentText(textElement));
    }

    Element htmlElement = XmlUtil.element(element, "html");
    if (htmlElement != null) {
      // extract child nodes from html element
      DocumentFragment fragment = htmlElement.getOwnerDocument().createDocumentFragment();
      for (Node child = htmlElement.getFirstChild(), next; child != null; child = next) {
        next = child.getNextSibling();
        fragment.appendChild(child);
      }
      mailTemplate.setHtml(XmlUtil.toString(fragment));
    }

    // attachments
    Element attachmentsElement = XmlUtil.element(element, "attachments");
    if (attachmentsElement != null) {
      for (Element attachmentElement : XmlUtil.elements(attachmentsElement, "attachment")) {
        AttachmentTemplate attachmentTemplate = new AttachmentTemplate();
        mailTemplate.addAttachmentTemplate(attachmentTemplate);

        attachmentTemplate.setUrl(XmlUtil.attribute(attachmentElement, "url"));
        attachmentTemplate.setResource(XmlUtil.attribute(attachmentElement, "resource"));
        attachmentTemplate.setFile(XmlUtil.attribute(attachmentElement, "file"));
      }
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.