Examples of EmailContent


Examples of com.google.code.lightssh.project.mail.entity.EmailContent

 
  /**
   * 邮件入队列
   */
  public void send( String addressee, String subject, String content ){
    EmailContent ec = newTransactionSave(addressee,subject,content);
    //send(ec);
    sendByThreadPool(ec);
  }
View Full Code Here

Examples of com.google.code.lightssh.project.mail.entity.EmailContent

 
  /**
   * 邮件入队列
   */
  public EmailContent newTransactionSave( String addressee, String subject, String content ){
    EmailContent ec = new EmailContent();
    ec.setType(EmailContent.Type.HTML );
    ec.setStatus( Status.NEW );
    ec.setFailureCount(0);
   
    ec.setAddressee(addressee);
    ec.setSubject(subject);
    ec.setContent(content);
   
    save(ec);
   
    return ec;
    //jobQueueManager.jobInQueue(QUEUE_KEY,ec.getId() );
View Full Code Here

Examples of com.google.code.lightssh.project.mail.entity.EmailContent

 
  /**
   * 更新状态
   */
  public void updateStatus(boolean success,EmailContent ec ){
    EmailContent entity = dao.read(ec);
    if( success ){
      entity.setFinishedTime(Calendar.getInstance());
      entity.setStatus( Status.SUCCESS );
    }else{
      entity.setStatus( Status.FAILURE );
      entity.incFailureCount( );
      entity.setErrMsg(ec.getErrMsg());
    }
   
    entity.setSender(ec.getSender());
   
    dao.update(entity);
  }
View Full Code Here

Examples of com.google.code.lightssh.project.mail.entity.EmailContent

 
  /**
   * 重发邮件
   */
  public void resend(EmailContent t ){
    EmailContent ec = updateStatus(t,Status.RESEND);
    if( ec != null){
      sendByThreadPool( ec );
      /*
      jobQueueManager.jobInQueue(
          EmailContentManager.QUEUE_KEY,ec.getId(),2);
 
View Full Code Here

Examples of com.google.code.lightssh.project.mail.entity.EmailContent

 
  /**
   * 更新状态
   */
  public EmailContent updateStatus(EmailContent t,Status status){
    EmailContent ec = get(t);
    if( ec != null){
      ec.setStatus( status );
      dao.update(ec);
    }
   
    return ec;
  }
View Full Code Here

Examples of com.google.code.lightssh.project.mail.entity.EmailContent

   */
  public void updateStatus(Collection<Result> results ){
    List<EmailContent> list = new ArrayList<EmailContent>();
   
    for( Result result:results ){
      EmailContent ec = get(result.getKey());
      if( ec == null )
        continue;
     
      list.add(ec);
      if( result.isSuccess() ){
        ec.setFinishedTime(Calendar.getInstance());
        ec.setStatus( Status.SUCCESS );
      }else{
        ec.setStatus( Status.FAILURE );
        if( result.getObject() != null && result.getObject() instanceof JobQueue ){
          JobQueue jq = (JobQueue)result.getObject();
          ec.incFailureCount( jq.getFailureCount());
          ec.setErrMsg(jq.getErrMsg());
        }
      }
    }
   
    dao.update(list);
View Full Code Here

Examples of com.serotonin.web.mail.EmailContent

            Set<String> addresses = new MailingListDao().getRecipientAddresses(reportConfig.getRecipients(),
                    new DateTime(reportInstance.getReportStartTime()));
            String[] toAddrs = addresses.toArray(new String[0]);

            // Create the email content object.
            EmailContent emailContent = new EmailContent(null, creator.getHtml(), Common.UTF8);

            // Add the consolidated chart
            if (creator.getImageData() != null)
                emailContent
                        .addInline(new EmailInline.ByteArrayInline(inlinePrefix + ReportChartCreator.IMAGE_CONTENT_ID,
                                creator.getImageData(), ImageChartUtils.getContentType()));

            // Add the point charts
            for (PointStatistics pointStatistics : creator.getPointStatistics()) {
                if (pointStatistics.getImageData() != null)
                    emailContent.addInline(new EmailInline.ByteArrayInline(inlinePrefix
                            + pointStatistics.getChartName(), pointStatistics.getImageData(), ImageChartUtils
                            .getContentType()));
            }

            // Add optional images used by the template.
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.