Skip to content

khanlou/MandrillTransport-CakePHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Mandrill CakePHP Plugin

This enables using CakeEmail from CakePHP 2.0 with Mandrill.

Installation

  1. Add an email configuration for the Mandrill Transport protocol. Add this to /app/Config/email.php. You may find it named email.php.default.

     public $mandrill = array(
     	'transport' => 'Mandrill',
     	'uri' => 'https://mandrillapp.com/api/1.0/',
     	'key' => 'your-key-here'
     );
    

    Be sure to update the API Key to your own key.

  2. Copy the MandrillTransport.php file to /app/Lib/Network/Email/MandrillTransport.php.

Usage

Usage is based on the CakeEmail class and specification.

To use, import the CakeEmail class:

App::uses('CakeEmail', 'Network/Email');

and use it like so when you want to send an email.

$email = new CakeEmail();
$email->config('mandrill');	
$email->from('[email protected]');
$email->to('[email protected]');
$email->subject('Subject for Email');
$result = $email->send('Here is some test content for the email.');

The $result object will contain information about the success or failure of the message sending.

It's very simple right now and doesn't support anything more complex, like multiple recipients or attachments.

© Soroush Khanlou 2013

About

This enables using CakeEmail from CakePHP 2.0 with Mandrill.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages