Coder Social home page Coder Social logo

mandrilltransport-cakephp's Introduction

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',
     	'emailFormat' => 'html',
     	'uri' => 'https://mandrillapp.com/api/1.0/',
     	'key' => 'your-key-here'
     );
    

    Be sure to update the API Key to your own key. Add other CakePHP settings as needed.

  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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.