Re: Emailing response formatted in html
Louis Moore <lrm718-/[email protected]> Thu, 9 Jun 2005 11:23:04 -0700 (PDT)
| Newsgroups | gmane.comp.java.keel.devel |
|---|---|
| Message-ID | <[email protected]> |
hi gene, You can do something like this with Velocity if you wanted. You would write a velocity template to do the formatting and then use Velocity runtime to process the template into the body of your email and send from your model. http://jakarta.apache.org/velocity Turbine does this -- here are the key classes involved: http://cvs.apache.org/viewcvs.cgi/jakarta-turbine-2/src/java/org/apache/turbine/util/velocity/VelocityEmail.java?rev=1.13&view=markup http://cvs.apache.org/viewcvs.cgi/jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/TurbineVelocityService.java?rev=1.35&view=markup This would roughly translate into a VelocityMailer class in svc-mail-javamail and a new velocity service: svc-template-velocity or something -- unless you can leverage the existing clnt-velocity somehow. Or... You could try using jakarta's element construction set -- I used this a long time ago. You can use it to construct markup like HTML using java objects. So you could create your html email body without actually writing out the markup yourself, use toString and set it as the body of your email, and send from your model. http://jakarta.apache.org/ecs/ The velocity solution is probably more reusable and elegant but ECS would take you less time. -Lou --- Gene McCullough <[email protected]> wrote: > Anybody have suggestions on emailing the results of > a model, formatted > in html? Or any other "readable" format for that > matter? > > what i'm needing to do is schedule a model to run > (I've figured that > part out), and in some form or fashion have the > results emailed to a > list of users (I've figured that part out), but in a > format that is > readily viewable. > > so I guess the proper question is How to go from a > response object to > formatted html without going thru struts and > returning it to a browser? > > TIA > gene > http://keelframework.org/documentation.shtml > Keelgroup mailing list > [email protected] > http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com > http://keelframework.org/documentation.shtml Keelgroup mailing list [email protected] http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com