Package com.agiletec.plugins.jpwebdynamicform.aps.system.services.message.model

Examples of com.agiletec.plugins.jpwebdynamicform.aps.system.services.message.model.MessageTypeNotifierConfig


  }

  protected boolean sendMessageNotification(Message message) throws ApsSystemException {
    boolean sent = false;
    try {
      MessageTypeNotifierConfig config = this.getNotifierConfig(message.getTypeCode());
      if (config != null && config.isNotifiable()) {
        MessageModel messageModel = config.getMessageModel();
        String renderingLangCode = this.getLangManager().getDefaultLang().getCode();
        String subject = this.getEntityRenderer().render(message, messageModel.getSubjectModel(), renderingLangCode, false);
        String text = this.getEntityRenderer().render(message, messageModel.getBodyModel(), renderingLangCode, true);

        String[] recipientsTo = config.getRecipientsTo();
        String[] recipientsCc = config.getRecipientsCc();
        String[] recipientsBcc = config.getRecipientsBcc();
        String senderCode = config.getSenderCode();
        this.getMailManager().sendMail(text, subject,
            recipientsTo, recipientsCc, recipientsBcc, senderCode, IMailManager.CONTENTTYPE_TEXT_HTML);
        sent = true;
      } else {
        ApsSystemUtils.getLogger().warn("Message notification not sent! Message lacking in notifier configuration.");
View Full Code Here


  protected boolean sendAnswerNotification(Answer answer) throws ApsSystemException {
    boolean sent = false;
    try {
      Message message = this.getMessage(answer.getMessageId());
      MessageTypeNotifierConfig config = this.getNotifierConfig(message.getTypeCode());
      if (config != null) {
        String email = this.extractUserMail(message, config);
        if (null!=email) {
          String renderingLangCode = message.getLangCode();
          if (renderingLangCode==null || this.getLangManager().getLang(renderingLangCode)==null) {
            renderingLangCode = this.getLangManager().getDefaultLang().getCode();
          }
          MessageModel messageModel = config.getMessageModel();
          String subject = this.getEntityRenderer().render(message, messageModel.getSubjectModel(), renderingLangCode, false);
          subject = "RE: " + subject;
          String text = answer.getText();
          String senderCode = config.getSenderCode();
          String[] recipientsTo = new String[] { email };
          Properties attachmentFiles = answer.getAttachments();
          this.getMailManager().sendMail(text, subject, IMailManager.CONTENTTYPE_TEXT_PLAIN,
              attachmentFiles, recipientsTo, null, null, senderCode);
          sent = true;
        } else {
          ApsSystemUtils.getLogger().warn("ATTENTION: email Attribute \"" +
              config.getMailAttrName() + "\" for Message \"" + message.getId() +
              "\" isn't valued!!\nCheck \"jpwebdynamicform_messageTypes\" Configuration or " +
              "\"" + JpwebdynamicformSystemConstants.MESSAGE_NOTIFIER_CONFIG_ITEM + "\" Configuration");
        }
      } else {
        ApsSystemUtils.getLogger().warn("Answer not sent! Message lacking in notifier configuration.");
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpwebdynamicform.aps.system.services.message.model.MessageTypeNotifierConfig

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.