I took a similar approach with HTML templates, but instead of rolling my own template processing I had my "controller" code create its own ViewCollection and ViewRenderer instances using the internal Model-Glue CFCs.
I know this is an undocumented and unsupported use of those CFCs but using them saved me a lot of time up front, and even if a future update of MG broke the code I can't imagine it would be too difficult to fix. -- Dennis On Sun, Aug 2, 2009 at 12:27 PM, James Allen <[email protected]>wrote: > > I use HTML templates that do sit within my views folder but they are read > in > via my EmailService (inside the email bean) and then sent out that way. > > I like this as it means anyone could edit the templates (I use placeholders > for replaceable content). Also keeps them nicely located. I recently had to > send them all to a colleague who needed to make text changes but is not > technical at all. > > Works well. > > --- > James Allen > E: [email protected] > Blog: http://jamesallen.name > Twitter: @CFJamesAllen (Coldfusion / Web development) > Twitter: @jamesallenuk (General) > > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > Behalf Of Sir Rawlins > Sent: 01 August 2009 16:03 > To: model-glue > Subject: [Model-Glue] sending emails from MG. > > > Hello Guys, > > I wanted to get your opinions on how you distribute emails from within > your MG apps. I'm sure I remember reading a thread a while back about > how some people consider an email a 'view' and so would render the > HTML as a view, this I guess was called from the model using an cfhttp > call or something? and then distributed. > > I myself have always just used a cfsavecontent tag in the model which > saves the HTML into a variable, this is then passed to a mailerservice > which contains all my POP/SMTP settings and this actually does the job > of sending the email. > > I wanted to see what others were doing as for me having the HTML mixed > in the model always felt a little messy to me. > > Cheers guys, appreciate your thoughts. > > Rob > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "model-glue" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/model-glue?hl=en For more about Model-Glue, check http://www.model-glue.com . -~----------~----~----~----~------~----~------~--~---
