cristiancy96/mandrill
Mandrill transactional emails via Laravel 4
30
2
| Install | |
|---|---|
composer require cristiancy96/mandrill |
|
| PHP: | >=5.3.0 |
| License: | MIT |
| Last Updated: | Dec 12, 2013 |
| Links: | GitHub · Packagist |
Maintainer: cristiancy96
Laravel Mandrill Request
Send Mandrill transactional emails from the Laravel 4 framework. This package is a updating of package doxxon and Laravel 4 wrapper around MichMich's Laravel Mandrill Bundle.
Installation
-
Edit your project's
composer.jsonfile and add a requirement fordoxxon/laravel-mandrill-request."require": { "laravel/framework": "4.1.*", "doxxon/laravel-mandrill-request": "dev-master" } -
Update composer from the command line:
composer update -
Open
app/config/app.phpand add the following line to theprovidersarray:'Doxxon\LaravelMandrillRequest\LaravelMandrillRequestServiceProvider', -
Add a facade alias to enable shorthand usage. Open
app/config/app.phpand add the following line to thealiasesarray:'Mandrill' => 'Doxxon\LaravelMandrillRequest\Facades\MandrillRequest', -
Publish the config files. This will allow you to set your Mandrill API key:
php artisan config:publish doxxon/laravel-mandrill-request -
Set your Mandrill API key by editing
config/packages/doxxon/laravel-mandrill-request/config.php:
return array(
'api_key' => 'your api key here',
);
Get your API keys from the Mandrill Dashboard
Usage
$payload = array(
'message' => array(
'subject' => 'Transactional email via Mandrill',
'html' => 'It works!',
'from_email' => 'fromemail@example.com',
'to' => array(array('email'=>'toemail@example.com'))
)
);
$response = Mandrill::request('messages/send', $payload);