Hello,

I have a need for a Spring-based framework to be used to send mail according to templates. And so I've written a partial one. It seems that this type of problem is required often enough that a similar one could enhance the Spring Framework -- I'm wondering if anyone agrees with this.

Such a framework would have the following concepts: an enhanced mail sender, a mail template, a mail template preparator, and mail template resolvers.

Mail templates would have logical names just like Views in MVC. They would be resolvable by a MailTemplateResolver. This enables caching and XML or ResourceBundle definition to be added just like views.

Once resolved, a preparator could convert the template from a template into a ready-to-send MimeMessage.

And finally, an enhanced mail sender could be set to accept a List of resolvers and a preparator. It could also be made to accept model data that should be available to every mail template, thus eliminating the need for service code to repeatedly add well-known data to the model meant for the template.

I think such a design has a place in Spring. I've developed my own implementation of this, but believe that a more considered implementation by the Spring team would be awesome!

Any thoughts?

Bill