https://github.com/dotblue/mandrill
OO library wrapping around Mandrill API
https://github.com/dotblue/mandrill
Last synced: 10 months ago
JSON representation
OO library wrapping around Mandrill API
- Host: GitHub
- URL: https://github.com/dotblue/mandrill
- Owner: dotblue
- License: other
- Created: 2014-01-27T15:59:08.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-07-29T09:26:10.000Z (almost 7 years ago)
- Last Synced: 2024-12-15T00:50:39.385Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 46.9 KB
- Stars: 14
- Watchers: 5
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
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](http://getcomposer.org/):
```sh
$ composer require dotblue/mandrill@~1.2
```
Of course you can always clone this repository and commit it into your project manually.
Usage
-----
```php
$mandrill = new DotBlue\Mandrill\Mandrill($apiKey);
$mailer = new DotBlue\Mandrill\Mailer(new DotBlue\Mandrill\Exporters\MessageExporter(), $mandrill);
$message = new DotBlue\Mandrill\Message();
$message->setFrom('maesters@citadel.sif');
$message->subject = 'Winter is coming!';
$message->addTo('jeoffrey@baratheon.sif');
$message->addBcc('varys@spider.sif');
$message->addBcc('petyr@baelish.sif');
$message->html = 'Winter is coming!';
$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](docs/en)