cristiancy96 / mandrill by cristiancy96

Mandrill transactional emails via Laravel 4
30
2
2
Package Data
Maintainer Username: cristiancy96
Maintainer Contact: cristiancy96@gmail.com (Cristian Cruz Yate)
Package Create Date: 2013-12-12
Package Last Update: 2013-12-12
Language: PHP
License: MIT
Last Refreshed: 2024-12-19 03:13:06
Package Statistics
Total Downloads: 30
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

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

  1. Edit your project's composer.json file and add a requirement for doxxon/laravel-mandrill-request.

     "require": {
     	"laravel/framework": "4.1.*",
     	"doxxon/laravel-mandrill-request": "dev-master"
     }
    
  2. Update composer from the command line:

     composer update
    
  3. Open app/config/app.php and add the following line to the providers array:

     'Doxxon\LaravelMandrillRequest\LaravelMandrillRequestServiceProvider',
    
  4. Add a facade alias to enable shorthand usage. Open app/config/app.php and add the following line to the aliases array:

     'Mandrill' => 'Doxxon\LaravelMandrillRequest\Facades\MandrillRequest',
    
  5. Publish the config files. This will allow you to set your Mandrill API key:

     php artisan config:publish doxxon/laravel-mandrill-request
    
  6. 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);

See the Mandril API Docs for more information