Welcome Guest, Not a member yet? Register   Sign In
Which Design Pattern can help me when I need send different emails in different actions
#2

[eluser]jedd[/eluser]
Hi huyi,

I'd *probably* have this as a helper function, that you can send the key bits of data to as parameters (addressee, subject, type of mail, and so on). In there you could have a switch based on 'type' if you want to get fancy with different email types for orders, account creation and so on.

If it's the kind of thing you are likely to do from every controller, you could put this function in [url="/wiki/MY_Controller"]MY_Controller[/url] (extend the core controller).

Certainly you're on the right track by coming at the problem as wanting to not repeat these processes in various places through your project.


Messages In This Thread
Which Design Pattern can help me when I need send different emails in different actions - by El Forum - 11-28-2010, 01:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB