This project is created to simplify sending transactional emails through Sendinblue using Laravel Mailables, Symfony/sendinblue-mailer and Sendinblue API V3 PHP library.
composer require concept7/laravel-sendinblue
Ensure that you have the following variables in your project's .env file:
SENDINBLUE_API_KEY=
APP_NAME=
MAIL_FROM_ADDRESS=
Add the following maildriver to config/mail.php in the mailers
array.
'sendinblue' => [
'transport' => 'sendinblue',
],
Set the MAIL_MAILER
.env variable to:
MAIL_MAILER=sendinblue
Create a new Mailable using php artisan make:mail
and add the Sendinblue
trait to the Mailable. Next, add ->sendinblue([])
to the Mailable instance and you're done.
use Concept7\LaravelSendinblue\Sendinblue;
class MyMailable extends Mailable
{
use Queueable,
SerializesModels,
Sendinblue;
/**
* Build the message
*/
public function build()
{
return $this
->to()
->sendinblue([
'template_id' => 1,
'params' => [
// insert parameters here
]
]);
}
}
The MIT License (MIT). Please see License File for more information.