Yeah I was thinking more about Dennis taking the ViewRenderer.cfc etc and rolling it into his own template processing service etc..
--- James Allen E: [email protected] Blog: http://jamesallen.name Twitter: @CFJamesAllen (Coldfusion / Web development) Twitter: @jamesallenuk (General) From: [email protected] [mailto:[email protected]] On Behalf Of Dan Wilson Sent: 03 August 2009 17:58 To: [email protected] Subject: [Model-Glue] Re: sending emails from MG. I shouldn't think it would be against the open source license. If you changed it and sold it to someone for a few million, we'd want a cut (all of us) but the source code can be changed at will according to the apache license, which is generally very friendly. DW On Mon, Aug 3, 2009 at 12:57 PM, James Allen <[email protected]> wrote: I suppose I was thinking of taking the CFC's and creating a totally different entity which was outside of MG. So the moment it was taken out it would never be part of the MG update cycle again anyway as it would be changing form. However, that may be against the open source license anyway so apologies if it is. --- James Allen E: [email protected] Blog: http://jamesallen.name Twitter: @CFJamesAllen (Coldfusion / Web development) Twitter: @jamesallenuk (General) From: [email protected] [mailto:[email protected]] On Behalf Of Dan Wilson Sent: 03 August 2009 17:51 To: [email protected] Subject: [Model-Glue] Re: sending emails from MG. Careful now. Branching MG into your own fork is something that should be done with plenty of respect for the framework as is. Model Glue has unique extensibility features that allow all developers to override parts of the framework without touching the framework code. If you actually change any of the framework code, you'll be off the MG upgrade cycle and would have to fix all bugs/add all updates by hand. So, just because you can, doesn't mean you should. Especially when there is probably an MG sanctioned way to accomplish what you want anyways. DW On Mon, Aug 3, 2009 at 12:50 PM, James Allen <[email protected]> wrote: That is pretty sweet. You could always take the MG code and branch it off into your own system. Sounds like a nice way of approaching this type of thing. --- James Allen E: [email protected] Blog: http://jamesallen.name Twitter: @CFJamesAllen (Coldfusion / Web development) Twitter: @jamesallenuk (General) From: [email protected] [mailto:[email protected]] On Behalf Of Dennis Clark Sent: 03 August 2009 17:32 To: [email protected] Subject: [Model-Glue] Re: sending emails from MG. Close enough. I instantiate a Model-Glue GenericCollection (which is how Unity implements its state container) and use the setValue() method to populate it with the data the view needs. I then call renderView() on the instantiated ViewRenderer, and pass it the state container, the view collection, and the path to the view template. The viewCollection is a required argument of renderView() to support view stacking, but since in my case I'm not performing any view stacking my viewCollection is empty. If I later find myself needing to send different types of emails and I wanted to create a common template view, it would be easy enough to add the rendered view to my viewCollection and then render the template view. Of course, the further I go down that road the further it feels like I'm duplicating Model-Glue's functionality (even if I am reusing MG's CFCs). -- Dennis On Mon, Aug 3, 2009 at 11:40 AM, James Allen <[email protected]> wrote: Oooh I like the sound of that - very inventive. So your HTML templates work very much like views with data passed into them via the ViewCollection? --- James Allen E: [email protected] Blog: http://jamesallen.name Twitter: @CFJamesAllen (Coldfusion / Web development) Twitter: @jamesallenuk (General) From: [email protected] [mailto:[email protected]] On Behalf Of Dennis Clark Sent: 03 August 2009 16:27 To: [email protected] Subject: [Model-Glue] Re: sending emails from MG. 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 -- "Come to the edge, he said. They said: We are afraid. Come to the edge, he said. They came. He pushed them and they flew." Guillaume Apollinaire quotes -- "Come to the edge, he said. They said: We are afraid. Come to the edge, he said. They came. He pushed them and they flew." Guillaume Apollinaire quotes --~--~---------~--~----~------------~-------~--~----~ 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 . -~----------~----~----~----~------~----~------~--~---
