tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Krohn <tors...@tsdb.com>
Subject Creating email content using templating library Tiles 2
Date Tue, 05 Aug 2008 12:42:25 GMT
Hi,

At the spring reference I found a velocity-based example to create email
content:

http://static.springframework.org/spring/docs/2.5.x/reference/mail.html#mail-templates-example

   private void sendConfirmationEmail(final User user) {
      MimeMessagePreparator preparator = new MimeMessagePreparator() {
         public void prepare(MimeMessage mimeMessage) throws Exception {
            MimeMessageHelper message = new MimeMessageHelper(mimeMessage);
            message.setTo(user.getEmailAddress());
            message.setFrom(emailstring);
            Map model = new HashMap();
            model.put("user", user);
            String text = VelocityEngineUtils.mergeTemplateIntoString(
               velocityEngine, "com/dns/registration-confirmation.vm",
model);
            message.setText(text, true);
         }
      };
      this.mailSender.send(preparator);
   }

Can I do this with Apache Tiles 2. If so, how?

Thank you,
Torsten

Mime
View raw message