Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elasticorange/laravel-mandrill-interface
https://github.com/elasticorange/laravel-mandrill-interface
Last synced: about 22 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/elasticorange/laravel-mandrill-interface
- Owner: ElasticOrange
- License: mit
- Created: 2015-04-29T09:53:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-16T14:12:43.000Z (over 9 years ago)
- Last Synced: 2024-11-05T21:16:48.055Z (about 2 months ago)
- Language: PHP
- Size: 129 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
laravel-mandrill
================Install it with
```
composer require "hydrarulz/laravel-mandrill-interface:dev-master"
```Add the service provider at the end of the `providers` array in file `config/app.php`:
```php
'Hydrarulz\LaravelMandrillInterface\LaravelMandrillInterfaceServiceProvider',
```The service provider will register an interface, but you should also register the alias at the end of the `aliases` array:
```php
'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:env('MANDRILL_TOKEN')
, 'pretend' => env('MAIL_PRETEND')
];Add your Mandrill token to the `.env` file and set the pretend value `true` of `false`.
# Mandrill setup
MANDRILL_TOKEN=YOUR_TOKEN_HERE
MAIL_PRETEND=falseAfter this you can start using it in your application
```php
$message = [
'to' => [
[
'email' => '[email protected]',
'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.