ebethus/laravel-elastic-email-driver
Laravel Elastic Email Driver
A Laravel mail driver for Elastic Email service.
Compatibility
- Laravel: 9.x, 10.x, 11.x, 12.x
- PHP: 8.0+
Installation
Install the package via Composer:
composer require ebethus/laravel-elastic-email-driver
Configuration
1. Add Elastic Email Credentials
Add the following configuration to your config/services.php:
'elastic_email' => [
'key' => env('ELASTIC_KEY'),
'account' => env('ELASTIC_ACCOUNT'),
],
2. Set Environment Variables
Add your Elastic Email credentials to your .env file:
ELASTIC_KEY=your-elastic-email-api-key
ELASTIC_ACCOUNT=your-elastic-email-account
3. Configure Mail Driver
For Laravel 9+, update your config/mail.php to add the Elastic Email mailer:
'mailers' => [
// ... other mailers
'elastic_email' => [
'transport' => 'elastic_email',
],
],
Then set it as your default mailer in .env:
MAIL_MAILER=elastic_email
For older Laravel versions, set:
MAIL_DRIVER=elastic_email
Usage
This package integrates seamlessly with Laravel's mail system. Use Laravel's Mail facade as you normally would:
use Illuminate\Support\Facades\Mail;
use App\Mail\WelcomeEmail;
Mail::to('user@example.com')->send(new WelcomeEmail());
For more information on sending emails, refer to the Laravel Mail documentation.
License
This package is open-sourced software licensed under the MIT license.
Support
For issues or questions, please contact alberroteran@gmail.com.
Related Packages
Package to send emails with attachements via an Elastic Email Mailer.
Package for send emails with attachments via elastic email driver
Package for send emails with attachments via elastic email driver