Sparkpost transport for Laravel
stidges/laravel-sparkpost-transport is a Laravel package for sparkpost transport for laravel.
It currently has 0 GitHub stars and 33.278 downloads on Packagist (latest version v3.0.2).
Install it with composer require stidges/laravel-sparkpost-transport.
Discover more Laravel packages by stidges
or browse all Laravel packages to compare alternatives.
Last updated
A Sparkpost transport for Laravel 11+
Note: use v1 of this package for Laravel 9.x support Note: use v2 of this package for Laravel 10.x support
You can install the package via composer:
composer require stidges/laravel-sparkpost-transport
To get started, update your config/services.php with your Sparkpost secret key like so:
<?php
return [
// ...
'sparkpost' => [
'secret' => env('SPARKPOST_SECRET'),
],
];
Next, add the Sparkpost transport to the mailers section of your config/mail.php:
<?php
return [
// ...
'mailers' => [
// ...
'sparkpost' => [
'transport' => 'sparkpost',
],
],
// ...
];
And finally, update your .env file to add the SPARKPOST_SECRET and to update the MAIL_MAILER:
MAIL_MAILER=sparkpost
SPARKPOST_SECRET=YourSecretKey
If you'd like to use the EU domain for Sparkpost, you can add the domain to your config/services.php file:
'sparkpost' => [
'secret' => env('SPARKPOST_SECRET'),
'domain' => 'api.eu.sparkpost.com',
],
You can add a options array to your config/services.php to add any data you would like to send to the Sparkpost API.
Any data in the options array will be merged into the API request body. For details on how you can customize the
transmission, review the Sparkpost API documentation
'sparkpost' => [
'secret' => env('SPARKPOST_SECRET'),
'options' => [
'campaign_id' => 'my_campaign_id',
'options' => [
'click_tracking' => false,
],
],
],
You can add any options to the Guzzle client by adding a guzzle array to your config/services.php file:
'sparkpost' => [
'secret' => env('SPARKPOST_SECRET'),
'guzzle' => [
'timeout' => 10,
],
],
The MIT License (MIT). Please see License File for more information.