Mail Plugin

I wanted to know if anyone has ever thought about integrating something like handlebars rendering engine into the Mail Plugin Body Token?

This way we could run all kinds of functionality instead of basic Body Tokens rendering inside of email?

Am I missing the boat or would this be something worthwhile to build/integrate?

If you’re not familiar with handlebars you can check it out at http://handlebarsjs.com/

My basic problem is trying to pass more complex structures to an email. Ideally I’d love to pass data like Order Details for an order email.

Currently I’m having to render the view and pass arguments to the renderView then pass that to the MailPlugin for it to finally send.

just a thought…probably doing something wrong :-/

Jeremy R. DeYoung
615.261.8201jeremy.deyoung@lunarfly.comLunarFly.com

You mean like

http://wiki.coldbox.org/wiki/Plugins:MailService.cfm

Scroll down to the bottom.

I’m currently using that exact method to render. It just seems like if we have BodyTokens and the MailPlugin renders them. We should also be able to do more advance features like loops, if statements, and formatting. just a thought.

I’m perfectly happy pre-Rendering the email view before I send it to the Mail Plugin.

Yeah, I see what you mean. If you raise a ticket I would vote for the MailService to leverage interception points.

There’s already a CFC for mustache – basically a similar thing to handlebars I presume:

https://github.com/pmcelhaney/Mustache.cfc

Perhaps that could be integrated somehow?

Tom.

brilliant! i’ll play with that a bit!

Actually it looks like that’s a fork. This is the one you want: https://github.com/rip747/Mustache.cfc

Yeah, with something like that you could use that as a custom MailService and extend the original.

Remember that the MailService is only a plugin and all plugins can be extended and customised to do what you want.