I need to send emails formatted with HTML. It seems an HTML email counts as a "view" element so it makes sense to render it using JSP.
However, the emailer task would be written in pure Java. How can I get the JSP output into Java?
i.e. I envision:
emailbody.jsp:
<c:out var="invoicebody">
<lots of html>
${invoice.price} etc...
</c:out>
emailsend.java:
setup db connection
setup email
call emailbody.jsp
email.body = invoicebody
email.send etc...
Something like that...
Right now I am scraping it through the http server but that just seems wrong.
What is the best way to format HTML emails? Using Tomcat 7, Servlet 3.0...
Thanks