Skip to content

dotblue/Mandrill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DotBlue\Mandrill

This is an OO library wrapping around Mandrill API for sending messages. Enjoy!

Requirements

PHP 5.4+ (we love short array syntax).

curl

Installation

The easiest way is to use Composer:

$ composer require dotblue/mandrill@~1.2

Of course you can always clone this repository and commit it into your project manually.

Usage

$mandrill = new DotBlue\Mandrill\Mandrill($apiKey);
$mailer = new DotBlue\Mandrill\Mailer(new DotBlue\Mandrill\Exporters\MessageExporter(), $mandrill);

$message = new DotBlue\Mandrill\Message();
$message->setFrom('[email protected]');
$message->subject = 'Winter is coming!';

$message->addTo('[email protected]');
$message->addBcc('[email protected]');
$message->addBcc('[email protected]');

$message->html = '<html><body>Winter is coming!</body></html>';
$message->text = 'Winter is coming!';

$mailer->send($message);

Similary you can send a template by using class DotBlue\Mandrill\TemplateMessage in combination with DotBlue\Mandrill\Mailer::sendTemplate method.

You can find more examples in Documentation

About

OO library wrapping around Mandrill API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •