Hi i approached the problem diffrently - i have a Email model that acts just like Email component (same api) but it doesnt render anything (faster) only saves the data( the seted data for the view , template , to ,from etc) in the db.
I also have a custom shell with a task that reads a batch of emails every couple of minutes and sends them using the email component ( also extended to use swift mailer but thats another thing). Look at the bakery about using the email component in a cake shell - Jippi made a great article about it. HTH, On Jan 29, 2008 6:09 PM, Matias Lespiau <[EMAIL PROTECTED]> wrote: > I would do something like this: > > custom_email_component.php in my controllers/components > > App::import('Component', 'Email'); > > class CustomEmailComponent extends EmailComponent { > > > function __db() { > // your code > } > } > > By setting $this->delivery to 'db' you method would be called instead of the > others. > > Is that what you need? > > This way you can extend the component while keeping the core clean. > > Cheers, > > -- > Matias Lespiau > http://www.gignus.com/ > > > > > > On Jan 29, 2008 2:49 PM, Jeraimee <[EMAIL PROTECTED]> wrote: > > > > In our project when we need to send email we actually input it into a > > database queue to be sent later via cron (a cake console app). We want > > to keep the functionality of the email component but need to add a > > __db (or whatever you would like to call it) method so we can choose > > between 'mail', 'smtp' and 'db' (or whatever). > > > > My first plan was to patch email.php so it would first see if $this- > > >delivery was defined, if not check parent:: however this can't be > > done (AFAIK) due so the way components are instantiated. > > > > Does anyone have any suggestions that don't involve me copying > > email.php into my components directory and potentially going out of > > sync with cake? > > > > > > > -- Marcin Domanski http://kabturek.info --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---