Package com.centraview.administration.emailsettings

Examples of com.centraview.administration.emailsettings.EmailSettingsLocal


      String fromAddress = contactRemote.getPrimaryEmailAddress(individualID,2);

      if (fromAddress != null && !fromAddress.equals("") && toList != null && toList.size() != 0)
      {
        EmailSettingsLocalHome emailSettingsHome = (EmailSettingsLocalHome)ic.lookup("local/EmailSettings");
        EmailSettingsLocal emailSettingsRemote = (EmailSettingsLocal)emailSettingsHome.create();
        emailSettingsRemote.setDataSource(dataSource);

        // Its a predefined Template for the replying message for Task Completion
        EmailTemplateForm taskTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_TASK);
        String subject = taskTemplateForm.getSubject();
        String bodyTemplate = taskTemplateForm.getBody()+ "\n";

        mailMessageVO.setToList(toList);
        mailMessageVO.setFromAddress(fromAddress);
        mailMessageVO.setHeaders("Task Completion");
        mailMessageVO.setSubject(subject);
        mailMessageVO.setBody(bodyTemplate+body);
        mailMessageVO.setContentType(MailMessageVO.PLAIN_TEXT_TYPE);

        boolean sendFlag = emailSettingsRemote.simpleMessage(individualID,mailMessageVO);
      }// end of if(fromAddress != null && !fromAddress.equals("") && toList != null && toList.size() != 0)
    }
    catch(Exception e){
      e.printStackTrace();
      String message =(String) e.getMessage();
View Full Code Here


      AuthorizationLocal authRemote=(AuthorizationLocal)authHome.create();
      authRemote.setDataSource(this.dataSource);

      // get the Default Error Message Template for the Support replying emails
      EmailSettingsLocalHome emailSettingsHome=(EmailSettingsLocalHome)ic.lookup("local/EmailSettings");
      EmailSettingsLocal emailSettingsRemote=(EmailSettingsLocal)emailSettingsHome.create();
      emailSettingsRemote.setDataSource(this.dataSource);

      // Its a predefined Template for the replying message for the newly created Ticket
      EmailTemplateForm ticketTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_SUPPORTTICKET);

      // Its a predefined Template for the replying message for the new created Thread
      EmailTemplateForm threadTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_SUPPORTTHREAD);

      // Its a predefined Template for the replying for Error Message
      EmailTemplateForm errorTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_SUPPORTERROR);

      emailSettingsRemote = null;
      emailSettingsHome = null;

      String defaultMessageBody = "";
View Full Code Here

              }
            } // end while (mocIter.hasNext())
          } // end if (attendeeVO.getContactID() != actVO.getOwner())
        } // end while (attendeesIter.hasNext())
        EmailSettingsLocalHome emailSettingsHome = (EmailSettingsLocalHome)ic.lookup("local/EmailSettings");
        EmailSettingsLocal emailSettingsRemote = (EmailSettingsLocal)emailSettingsHome.create();
        emailSettingsRemote.setDataSource(dataSource);
        // get the template definition from the database. Some of it is dynamically configured by
        // the Administrator, and some of it is dynamically replaced here
        EmailTemplateForm activityTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_ACTIVITES);
        // Subject
        String activityType = this.getActivityTypeName(actVO.getActivityType());
        String activityTitle = basicActivityVO.getTitle();
        String subject = activityType + " Invitation: " + activityTitle;
        // Body
        StringBuffer body = new StringBuffer("");
        String bodyTemplate = activityTemplateForm.getBody();
        if (bodyTemplate != null && bodyTemplate.length() > 0) {
          body.append("\n\n" + bodyTemplate + "\n\n");
        }
        body.append("Type: " + activityType + "\n");
        body.append("Title: " + activityTitle + "\n");
        String details = "";
        if (basicActivityVO.getActivityDetails() != null && !basicActivityVO.getActivityDetails().equals("")) {
          details = basicActivityVO.getActivityDetails();
        }
        body.append("Details: " + details + "\n\n");
        SimpleDateFormat dateFormatter = new SimpleDateFormat("MM/dd/yyyy hh:mm a");
        Timestamp startDateTime = basicActivityVO.getActivityStartDate();
        if (startDateTime != null) {
          String startDate = dateFormatter.format(startDateTime);
          body.append("Start: " + startDate + "\n");
        }
        Timestamp endDateTime = basicActivityVO.getActivityEndDate();
        if (endDateTime != null) {
          String endDate = dateFormatter.format(endDateTime);
          body.append("End: " + endDate + "\n");
        }
        body.append("Creator: " + basicActivityVO.getOwnerName() + "\n\n");
        MailMessageVO mailMessageVO = new MailMessageVO();
        mailMessageVO.setFromAddress(fromAddress);
        mailMessageVO.setHeaders("X-CentraView-Activity-Invitation: true");
        mailMessageVO.setSubject(subject);
        mailMessageVO.setBody(body.toString());
        mailMessageVO.setContentType(MailMessageVO.PLAIN_TEXT_TYPE);
        mailMessageVO.setReceivedDate(new java.util.Date());
        if (toList != null && toList.size() != 0) {
          mailMessageVO.setToList(toList);
          boolean sendFlag = emailSettingsRemote.simpleMessage(userId, mailMessageVO);
        }
      }
    } catch (Exception e) {
      logger.error("[Exception] ActivityHelperEJB.extraActions: ", e);
    }
View Full Code Here

TOP

Related Classes of com.centraview.administration.emailsettings.EmailSettingsLocal

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.