yektadg/laravel-elastic-email

Package to send emails with attachements via an Elastic Email Mailer.

1.0.1 2021-03-19 17:13 UTC

This package is not auto-updated.

Last update: 2024-06-13 15:39:59 UTC


README

Laravel Elastic Email is a wrapper for Elastic Email. You can send e-mails in your project just like you usually do with Laravel's native mailers, the package makes sure the e-mails are send via the Elastic Email API using your Elastic Email account.

Requires

Laravel version 9 or higher.

Installation

  • Step 1: Install package via composer.
composer require yektadg/laravel-elastic-email
  • Step 2: Add your account and API keys to your .env file.
ELASTIC_ACCOUNT=<Your public account key>
ELASTIC_KEY=<Your API key>
  • Step 3: Update MAIL_MAILER with 'elastic_email' in your .env file.
MAIL_MAILER=elastic_email
  • Step 4: Add this new mailer to your config/mail.php* file.
'mailers' => [
    ...
    'elastic_email' => [
        'transport' => 'elasticemail',
        'key' => env('ELASTIC_KEY'),
        'account' => env('ELASTIC_ACCOUNT')
    ],  
    ...
],
  • Step 5: In your config/app.php file go to your providers array and comment out Laravel's default MailServiceProvider and add the following package provider:
'providers' => [
    /*
     * Laravel Framework Service Providers...
     */
    ...
//    Illuminate\Mail\MailServiceProvider::class,
      \FlexFlux\LaravelElasticEmail\LaravelElasticEmailServiceProvider::class,
    ...
],

Usage

Read Laravels documentation on how to send E-mails with the Laravel Framework.

https://laravel.com/docs/8.x/mail