SparkPost driver to use with Laravel 7.x
This package allows you to still use SparkPost as MailDriver in Laravel.
This package is inspired by: https://github.com/clarification/sparkpost-laravel-driver and updated with driver from Laravel 5.8.x
Find the correct version to use in the table below:
You can install the package via composer:
composer require vemcogroup/laravel-sparkpost-driver
The package will automatically register its service provider.
Sparkpost API options
You can define specific [SparkPost options]
You are able to use the EU endpoint for Europe GDPR compliance by setting the
endpoint option or the default will be used.
You are able to specify Guzzle options in the SparkPost config section
'sparkpost' => [ 'secret' => env('SPARKPOST_SECRET'), 'guzzle' => [ 'verify' => true, 'decode_content' => true, ... ], 'options' => [ 'endpoint' => env('SPARKPOST_ENDPOINT'), 'open_tracking' => false, 'click_tracking' => false, 'transactional' => true, ], ],
You will also need to add the SparkPost API Key to your environment file
Finally you need to set your mail driver to SparkPost. You can do this by changing the driver in
'driver' => env('MAIL_DRIVER', 'sparkpost'),
Or by setting the environment variable
MAIL_DRIVER in your
If you are using a clean Laravel 7.x installation its important you add the following sparkpost config in
config/mail.php mailer section.
'mailers' => [ ... 'sparkpost' => [ 'transport' => 'sparkpost' ], ... ],
And replace the
MAIL_DRIVER from .env with
MAIL_MAILER, make sure to keep the sparkpost config on