No, i just create the content in a central place. I use one of the bakery mail components.
The situation is the following. I have template for a lot of emails in the database (table emails). in my emails controller i wanted to replace the variables with real life content and let the mail component handle the delivery. the idea was that any controller should be able to send emails with one line of code, and without the necessity of defining text or anything else. just the userid and a type of mail. the rest should be held in database. On 21 Sep., 13:27, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 9/21/07, deepc <[EMAIL PROTECTED]> wrote: > > > OK, i see. > > if i move it to the model, is it still posible to access other models. > > for example i have to get some data from my users table. > > let me guess - you are getting the data which you want to send in the > email in the send() method? > > I would suggest that you refactor the send method to do precisely one > thing - send emails > > Everything else should be done somewhere else - most likely the > associated controller action from where send is being called > > send() method can accept a number of parameters > > Better still grab one of the email components from Bakery and save > yourself the hassle of reinventing the wheel > > T > > -- > ============================================================= > Cheesecake-Photoblog:http://cheesecake-photoblog.org > PHP for E-Biz:http://sanisoft.com > ============================================================= --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
