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?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to