I'm writing messages into my db's messages-table from different
controllers throughout my app using various functions of my Message
model. Depending on the user's notification settings, these messages
should be sent by email to the user as well and therefore written to a
mailqueue-table. I think the Message-model's afterSave() callback
function would be a good place to do that.

Now the question: Because I want a nicely rendered email, I want to
use Cake's Email Component but I cannot figure out how to use that
from the model.

Regarding application layers this is maybe not the rights place, but i
want to avoid rendering the email in all the controllers, when the
email might be not even be needed at all.

So would it make sense, to instantiate the component from the Model
and if yes how to do that ... and if no, how is the better setup?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to