cyber-duck / laravel-alternative-mailer
Allow Laravel to send emails through two different mail configurations.
Installs: 2 324
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 5
Forks: 1
Open Issues: 0
Requires
- php: >=5.5.9
- illuminate/mail: ^5.1.0
Requires (Dev)
- laravel/laravel: ~5.1
- mockery/mockery: ~0.9.4
- phpunit/phpunit: ~4.0
- squizlabs/php_codesniffer: 2.*
- symfony/dom-crawler: 2.8.*|3.0.*
Suggests
- aws/aws-sdk-php: Required to use the SES mail driver (~3.0).
- guzzlehttp/guzzle: Required to use the Mailgun and Mandrill mail drivers (~5.3|~6.0).
- jeremeamia/superclosure: Required to be able to serialize closures (~2.0).
This package is auto-updated.
Last update: 2021-10-26 10:00:06 UTC
README
This package is available in Laravel be default in later releases.
Laravel Alternative Mailer
This package allows a Laravel 5 application to send emails through two different mail configurations. This package has been adapted from illuminate/mail by Taylor Otwell.
Author: Simone Todaro
Install
Require this package with composer:
composer require cyber-duck/laravel-alternative-mailer:~1.0.2
After updating composer, add the ServiceProvider to the providers array in config/app.php
'providers' => array( ... 'Cyberduck\Mail\MailServiceProvider' )
And add an alias in config/app.php
:
'aliases' => array( 'Mail2' => 'Cyberduck\Mail\Facades\Mail', )
Copy the package config to your local config with the publish command:
php artisan vendor:publish --provider="Cyberduck\Mail\MailServiceProvider"
Finally, set up your configuration in config/mail2.php
Usage
To send an email with the alternative configuration, use the Mail2 facade with the same syntax of the Mail facade.
\Mail2::send('emails.reminder', ['user' => $user], function ($m) use ($user) { $m->from('hello@app.com', 'Your Application'); $m->to($user->email, $user->name); $m->subject('Your Reminder!'); });