2017 © Pedro Peláez
 

library laravel-mandrill-interface

Laravel mandrill interface oriented towards send templates. Because Laravel does not support that out of the box

image

hydrarulz/laravel-mandrill-interface

Laravel mandrill interface oriented towards send templates. Because Laravel does not support that out of the box

  • Thursday, July 16, 2015
  • by hydrarulz
  • Repository
  • 4 Watchers
  • 0 Stars
  • 311 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

laravel-mandrill

Install it with, (*1)

composer require "hydrarulz/laravel-mandrill-interface:dev-master"

Add the service provider at the end of the providers array in file config/app.php:, (*2)

'Hydrarulz\LaravelMandrillInterface\LaravelMandrillInterfaceServiceProvider',

The service provider will register an interface, but you should also register the alias at the end of the aliases array:, (*3)

'LaravelMandrillInterface' => 'Hydrarulz\LaravelMandrillInterface\Facades\LaravelMandrillInterface',

Then the you should publish the config file with php artisan vendor:publish This creates your config file /config/laravel-mandrill-interface.php that looks like this:, (*4)

<?php

return [
    'token' => env('MANDRILL_TOKEN')
    , 'pretend' => env('MAIL_PRETEND')
];

Add your Mandrill token to the .env file and set the pretend value true of false., (*5)

# Mandrill setup
MANDRILL_TOKEN=YOUR_TOKEN_HERE
MAIL_PRETEND=false

After this you can start using it in your application, (*6)

$message = [
    'to' => [
        [
            'email' => 'example@server.com',
            'name' => 'Daniel Luca',
            'type' => 'to'
        ]
    ]
    , 'global_merge_vars' => [
        [
            'name' => 'VARIABLE_ID'
            , 'content' => '1234'
        ]
    ]
];

$mandrill_interface = LaravelMandrillInterface::getInstance();
$mandrill_interface->sendTemplate(
    'your_template'
    , []
    , $message
    , true
);

Or event the send method., (*7)

The Versions

16/07 2015

dev-master

9999999-dev

Laravel mandrill interface oriented towards send templates. Because Laravel does not support that out of the box

  Sources   Download

MIT

The Requires