Examples of NewsletterConfig


Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

 
  /**
   * Create link for email confirmation
   * */
  protected String createLink(String mailAddress, String token) {
    NewsletterConfig config = this.getConfig();
    String langcode = this.getLangManager().getDefaultLang().getCode();
    String pageCode = config.getSubscriptionPageCode();
    String applBaseUrl = this.getConfigManager().getParam(SystemConstants.PAR_APPL_BASE_URL);
    StringBuffer link = new StringBuffer(applBaseUrl);
    link.append(langcode);
    link.append("/");
    link.append(pageCode);
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

    return body;
  }
 
  protected void sendSubscriptionFormThread(String mailAddress, String token) throws ApsSystemException {
    try {
      NewsletterConfig config = this.getConfig();
     
      String senderCode = config.getSenderCode();
      String subject = config.getSubscriptionSubject();
      if (subject!=null) {
        Map<String, String> bodyParams = new HashMap<String, String>();
        String link = this.createLink(mailAddress, token);
        bodyParams.put("subscribeLink", link);
        String textBody = this.parseText(config.getSubscriptionTextBody(), bodyParams);
        String[] recipientsTo = new String[] { mailAddress };
        if (config.isAlsoHtml()) {
          String htmlBody = this.parseText(config.getSubscriptionHtmlBody(), bodyParams);
          this.getMailManager().sendMixedMail(textBody, htmlBody, subject, null, recipientsTo, null, null, senderCode);
        } else {
          this.getMailManager().sendMail(textBody, subject, recipientsTo, null, null, senderCode, IMailManager.CONTENTTYPE_TEXT_PLAIN);
        }
      } else {
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

    return false;
  }
 
  private void sendContentsToSubscribers(List<Content> contents, NewsletterReport newsletterReport) throws ApsSystemException {
    List<Subscriber> subscribers = this.searchSubscribers(null, new Boolean(true));
    NewsletterConfig config = this.getConfig();
    for (Subscriber subscriber : subscribers) {
      String mailAddress = subscriber.getMailAddress();
      String[] emailAddresses = { mailAddress };
      String simpleText = this.prepareSubscribersMailBody(contents, newsletterReport, false, mailAddress);
      if (config.isAlsoHtml()) {
        String htmlText = this.prepareSubscribersMailBody(contents, newsletterReport, true, mailAddress);
        this.getMailManager().sendMixedMail(simpleText, htmlText, config.getSubject(), null, null, null, emailAddresses, config.getSenderCode());
      } else {
        this.getMailManager().sendMail(simpleText, config.getSubject(), null, null, emailAddresses, config.getSenderCode());
      }
    }
  }
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

      }
    }
  }
 
  private String prepareSubscribersMailBody(List<Content> userContents, NewsletterReport newsletterReport, boolean isHtml, String mailAddress) {
    NewsletterConfig config = this.getConfig();
    String unsubscriptionLink = isHtml ? config.getSubscribersHtmlFooter() : config.getSubscribersTextFooter();
    if (unsubscriptionLink!=null) {
      StringBuffer body = this.prepareMailCommonBody(userContents, newsletterReport, isHtml);
      String link = this.createUnsubscriptionLink(mailAddress);
      Map<String, String> footerParams = new HashMap<String, String>();
      footerParams.put("unsubscribeLink", link);
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

 
  /**
   * Create link for newsletter unsubscription
   * */
  protected String createUnsubscriptionLink(String mailAddress) {
    NewsletterConfig config = this.getConfig();
    String langcode = this.getLangManager().getDefaultLang().getCode();
    String pageCode = config.getUnsubscriptionPageCode();
    String applBaseUrl = this.getConfigManager().getParam(SystemConstants.PAR_APPL_BASE_URL);
    StringBuffer link = new StringBuffer(applBaseUrl);
    link.append(langcode);
    link.append("/");
    link.append(pageCode);
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.