On 7 févr. 2011, at 19:57, Dan Allen wrote:
Seam devs,
Cody is looking for some feedback on the mail module [1] before he drafts a reference guide and puts the API on ice.
Seam mail is important because, let's face it, the Java Mail API needs a makeover. Thankfully, the CDI programming model offers the necessary hooks to create a modernized mail API capable of deep integration with the Java EE platform (specifically the Java Mail API and container-managed sessions).
Seam Mail offers a fluent API that makes sending e-mail in Java a painless experience. But an e-mail is nothing without the content. That's why Seam Mail offers several templating options, such as Velocity, as well as an extensible template SPI, to allow you to select your templating solution of choice. With Seam Mail, you'll be sending e-mail from your application in no time.
Is this how you imagined it would be?
Basic:
@Inject
private Instance<MailMessage> mailMessage;
@Inject
private Session session;
mailMessage.get()
.subject("Text Message from Seam Mail - " + java.util.UUID.randomUUID().toString())
.textBody(text)
.send(session);
Velocity:
@Inject
private Instance<VelocityMailMessage> velocityMailMessage;
@Inject
private Session session;
.to(person.getName(), person.getEmail())
.subject("HTML Message from Seam Mail - " + java.util.UUID.randomUUID().toString())
.templateHTMLFromClassPath("template.html.vm")
.put("version", "Seam 3")
.importance(MessagePriority.HIGH)
.send(session);
We look forward to your feedback.
-Dan
_______________________________________________
seam-dev mailing list
seam-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/seam-dev