Package evolaris.framework.async.business.communication.email

Examples of evolaris.framework.async.business.communication.email.EmailAddress


    if (emailSendForm.getDestinationSelection() == null){
      emailSendForm.setDestinationSelection(-1)// none selected
    }
    if (emailSendForm.getFromEmail() == null || emailSendForm.getFromEmail().trim().length() == 0){
      if (webUser.getEmail() != null){
        EmailAddress webUserEmailAddress = new EmailAddress(webUser);
        emailSendForm.setFromEmail(webUserEmailAddress.getEmail());
        emailSendForm.setFromPersonalName(webUserEmailAddress.getPersonalName());
      }
      // no from setting if web user does not have e-mail configured => non-administrators must configure in personal settings
    }
    if (emailSendForm.getFromPersonalName() == null || emailSendForm.getFromPersonalName().trim().length() == 0){
      emailSendForm.setFromPersonalName((webUser.getFirstName() == null ? "" : webUser.getFirstName()) + " " + (webUser.getLastName() == null ? "" : webUser.getLastName()).trim());
View Full Code Here


      // reset also confirmation pending because enter will not be called
      emailSendForm.setSendConfirmationPending(false);
      return mapping.findForward("invalidToken");
    }

    EmailAddress fromAddress = new EmailAddress(webUser,emailSendForm.getFromEmail(),emailSendForm.getFromPersonalName() == null ? null : emailSendForm.getFromPersonalName());
    Long userSetId = emailSendForm.getUserSetId();
    Long userId = emailSendForm.getUserId();
    Set<User> users=null;

    Integer destinationSelection = emailSendForm.getDestinationSelection();
    switch (destinationSelection==null?0:destinationSelection){
    case 1// user set
      UserSetManager userSetManager = new UserSetManager(locale,session);
      if (userSetId.longValue() == -1){
        String noUserSetSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSetSelected");
        req.setAttribute("generalError",noUserSetSelectedString);
        return mapping.findForward("notSent");
      }
      UserSet userSet =  userSetManager.getUserSet(userSetId);
      if (userSet == null){
        throw new ConfigurationException("illegal user set id: " + userSetId);
      }
      users = userSet.getUsers();
      break;
    case 2: // user
      if (userId.longValue() == -1){
        String noUserSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSelected");
        req.setAttribute("generalError",noUserSelectedString);
        return mapping.findForward("notSent");
      }
      UserManager userManager = new UserManager(locale,session);
      User user = userManager.getUserDetails(userId);
      if (user == null){
        throw new ConfigurationException("illegal user id: " + user);
      }
      Set<User> oneManSet = new HashSet<User>();
      oneManSet.add(user);
      users = oneManSet;
      break;
    case 3// e-mail address
      EmailAddress toAddress = new EmailAddress(emailSendForm.getToEmail(), emailSendForm.getToPersonalName());
      SortedSet<EmailAddress> receivers = new TreeSet<EmailAddress>();
      receivers.add(toAddress);
      MessagingManager msgMgr = new MessagingManager(locale, session);
      msgMgr.sendEmail(fromAddress, receivers, getCurrentGroup(req), emailSendForm.getSubject(), emailSendForm.getMessage(), emailSendForm.getMimeType() == null ? MailSender.MIME_TYPE_PLAIN_TEXT : emailSendForm.getMimeType().intValue(), sendAt);
      Date date = new Date(System.currentTimeMillis());
View Full Code Here

  // prepares from address
  private void prepareEmailSenderAddress(EmailInteractionEnterOrEditForm emailInteractionEnterOrEditForm){
    if (emailInteractionEnterOrEditForm.getFromEmail() == null || emailInteractionEnterOrEditForm.getFromEmail().trim().length() == 0){
      if (webUser.getEmail() != null){
        EmailAddress webUserEmailAddress = new EmailAddress(webUser);
        emailInteractionEnterOrEditForm.setFromEmail(webUserEmailAddress.getEmail());
        emailInteractionEnterOrEditForm.setFromPersonalName(webUserEmailAddress.getPersonalName());
      }
      // no from setting if web user does not have e-mail configured => non-administrators must configure in personal settings
    }
    if (emailInteractionEnterOrEditForm.getFromPersonalName() == null || emailInteractionEnterOrEditForm.getFromPersonalName().trim().length() == 0){
      emailInteractionEnterOrEditForm.setFromPersonalName((webUser.getFirstName() == null ? "" : webUser.getFirstName()) + " " + (webUser.getLastName() == null ? "" : webUser.getLastName()).trim());
View Full Code Here

TOP

Related Classes of evolaris.framework.async.business.communication.email.EmailAddress

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.