There are times where I seriously feel the need to send an email from
the model like at the afterSave() stage or something. Say each time a
new comment is added to a post, a notification will be sent to
participants depending on certain conditions. It just feels more
correct having those checks and sending of emails in the model.

E.g. Controller:

$this->Model->saveThis($someComment);
if ($this->Model->shouldSendNotification()) {
  $data = $this->Model->getNecessaryData();
  $this->__sendNotificationWithEmailComponent($data);
}

Why not have saveThis() do the work and send the notifications? I do
think that it will be possible to just pass the Email component into
the model but is that technically correct? How did you do yours?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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