CakeResque Email Plugin
This plugin provides all the tools you need to immediately begin sending emails via a CakeResque powered queue. This saves the user time during the standard HTTP request cycle.
Install the cake-resque plugin.
git submodule add git://github.com/kamisama/Cake-Resque.git
Configure CakeResque as per the CakeResque instructions.
Install the cake-resque-email plugin.
git submodule add git://github.com/kochb/cake-resque-email.git app/Plugin/ResqueEmail
Ensure both are listed in your plugins array.
CakePlugin::load(array( 'Resque' => array('bootstrap' => true), 'ResqueEmail' ));
Ensure that your application is sending email via CakeEmail.
In your email.php file, set the transport for any emails you would like to process via a queue to
public $default = array( 'transport' => 'ResqueEmail.Queued', 'from' => array('email@example.com' => 'Our Team') );
In your email.php file, add an email configuration directive to be used when processing the queue, and name it $resqueEmail. Example:
public $resqueEmail = array( 'host' => 'ssl://smtp.gmail.com', 'port' => 465, 'username' => 'firstname.lastname@example.org', 'password' => 'secret', 'transport' => 'Smtp' );
Ensure that a worker is running and give it a test. You should receive your message on delay through the queue, and load times on pages that send emails should improve.
You should expect awkward behavior when using html/both as the email format AND specifying a message via CakeEmail::send('message'). There shouldn't be much of a reason to mix the two since an HTML email should be using CakeEmail::viewVars instead. Text emails and CakeEmail::send('message') work perfectly fine.