Package org.springframework.templating

Examples of org.springframework.templating.StringTemplate


 
  public SimpleMailMessage convert(ResetPasswordRequest request) {
    SimpleMailMessage mailMessage = new SimpleMailMessage();
    mailMessage.setFrom("Greenhouse <noreply@springsource.com>");
    mailMessage.setTo(request.getAccount().getEmail());
    StringTemplate textTemplate;
    mailMessage.setSubject("Reset your Greenhouse password");
    textTemplate = resetTemplateFactory.getStringTemplate();
    textTemplate.put("firstName", request.getAccount().getFirstName());   
    textTemplate.put("resetUrl", resetUriTemplate.expand(request.getToken()));
    mailMessage.setText(textTemplate.render());
    return mailMessage;
  }
View Full Code Here


    this.inviteRepository = inviteRepository;
    this.acceptUriTemplate = new UriTemplate(acceptUriTemplate);
  }

  public void sendInvite(Account from, List<Invitee> to, String invitationBody) {
    StringTemplate textTemplate = textTemplateFactory.getStringTemplate();
    textTemplate.put("account", from);
    StringTemplate bodyTemplate = new LocalStringTemplate(invitationBody);
    for (Invitee invitee : to) {
      bodyTemplate.put("invitee", invitee);
      textTemplate.put("body",  bodyTemplate.render());
      String token = tokenGenerator.generateKey();
      textTemplate.put("acceptUrl", acceptUriTemplate.expand(token));
      send(from, invitee, textTemplate.render(), token);
    }
  }
View Full Code Here

  }
 
  // internal helpers
 
  private String renderStandardInvitationText(Account account) {
    StringTemplate template = inviteTemplateFactory.getStringTemplate();
    template.put("account", account);
    return template.render();
  }
View Full Code Here

  public MailMessage welcomeMail(Account account) {
    SimpleMailMessage mailMessage = new SimpleMailMessage();
    mailMessage.setFrom("Greenhouse <noreply@springsource.com>");
    mailMessage.setTo(account.getEmail());
    mailMessage.setSubject("Welcome to the Greenhouse!");
    StringTemplate textTemplate;
    textTemplate = welcomeTemplateFactory.getStringTemplate();
    textTemplate.put("firstName", account.getFirstName());
    textTemplate.put("profileUrl", account.getProfileUrl());
    mailMessage.setText(textTemplate.render());
    return mailMessage;
  }
View Full Code Here

TOP

Related Classes of org.springframework.templating.StringTemplate

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.