Laravel Elastic Email
A Laravel wrapper for Elastic Email, (*1)
Can send emails with multiple attachments, (*2)
Installation
Install package via composer, (*3)
composer require rdanusha/laravel-elastic-email
Add this code to .env file, (*4)
ELASTIC_ACCOUNT=<Add your account>
ELASTIC_KEY=<Add your key>
Update MAIL_DRIVER value as 'elastic_email' in your .env file, (*5)
MAIL_DRIVER=elastic_email
Add this code to your config/services.php file, (*6)
'elastic_email' => [
'key' => env('ELASTIC_KEY'),
'account' => env('ELASTIC_ACCOUNT')
]
Open config/app.php file and go to providers array, Then comment out Laravel's default MailServiceProvider and add the following, (*7)
'providers' => [
/*
* Laravel Framework Service Providers...
*/
...
// Illuminate\Mail\MailServiceProvider::class,
Rdanusha\LaravelElasticEmail\LaravelElasticEmailServiceProvider::class,
...
],
Usage
This package works exactly like Laravel's native mailers. Refer to Laravel's Mail documentation., (*8)
https://laravel.com/docs/5.5/mail, (*9)
Code Example
Mail::to($request->user())->send(new OrderShipped($order));