Package com.changestuffs.client.i18n

Examples of com.changestuffs.client.i18n.ChangestuffsMessages


    return new SendInvitationResult(emailSent);
  }
 
  private void sendEmail(String emailFrom, String emailTo, String token) throws AddressException, MessagingException, IOException{
    Locale locale = requestProvider.get().getLocale();
    ChangestuffsMessages translator = GWTI18N.create(ChangestuffsMessages.class, locale.toString());
    log.info("locale: "+locale);
    Session session = Session.getDefaultInstance(props, null);
    MimeMessage msg = new MimeMessage(session);
        msg.setFrom(new InternetAddress(emailFrom));
        msg.addRecipient(Message.RecipientType.TO, new InternetAddress(emailTo));
        msg.setSubject(translator.inviteContact(emailFrom));
        String body = htmlEngine.htmlInviteContact(locale, emailTo, emailFrom, DOMAIN, CANCEL, token);
        msg.setContent(body, "text/html; charset=utf-8");
        log.info("Trying to send email: "+body);
        Transport.send(msg);
  }
View Full Code Here


  }

  private void sendEmail(OfferInfo offerInfo) {
    if (offerInfo.getUser().isReceiveEmails()) {
      Locale locale = requestProvider.get().getLocale();
      ChangestuffsMessages translator;
      try {
        translator = GWTI18N.create(ChangestuffsMessages.class,
            locale.toString());

        Session session = Session.getDefaultInstance(props, null);
        MimeMessage msg = new MimeMessage(session);
        msg.setFrom(new InternetAddress(Constants.CHANGESTUFFS_EMAIL));
        msg.addRecipient(Message.RecipientType.TO, new InternetAddress(
            offerInfo.getUser().getEmail()));
        msg.setSubject(translator.offerReceibed(offerInfo
            .getProductName()));
        String body = htmlEngine.htmlUpdateOffer(locale, offerInfo
            .getUser().getEmail(), offerInfo.getProductName(),
            PRODUCT_URL + offerInfo.getProductId(),
            SendInvitationActionHandler.CANCEL
View Full Code Here

TOP

Related Classes of com.changestuffs.client.i18n.ChangestuffsMessages

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.