mograine/laravel-sendinblue-template

A Laravel 7/8/9 service provider, facade and config file for the SendinBlue's API v3 official PHP library.
1,430
Install
composer require mograine/laravel-sendinblue-template
Latest Version:v1.3.3
PHP:^8.1
License:MIT
Last Updated:Jul 10, 2025
Links: GitHub  ·  Packagist
Maintainer: Mograine

Laravel Sendinblue Notification Template

Latest Version on Packagist Total Downloads License

The package simply provides a Laravel service provider, facade and config file for the SendinBlue's API v3 official PHP library. https://github.com/sendinblue/APIv3-php-library

It also allow to simply send a laravel notification using a SendInBlue transactional template.

Installation

You can install this package via Composer using:

composer require mograine/laravel-sendinblue-template-template

Configuration

You need to publish the config file to app/config/sendinblue.php. To do so, run:

php artisan vendor:publish --tag=sendinblue.config

Now you need to set your configuration using environment variables. Go the the Sendinblue API settings and add the v3 API key to your .env file.

SENDINBLUE_API_KEY=xkeysib-XXXXXXXXXXXXXXXXXXX
SENDINBLUE_EMAIL=defaultEmail
SENDINBLUE_NAME=defaultName

Usage

This package provide a built-in notification channel to send transactional template emails.

To test it, create a new notification using the php artisan make:notification command.

Example of usage :

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Mograine\Sendinblue\SendinblueMailTemplateChannel;
use Mograine\Sendinblue\TemplateMessage;

class NewOfferNotification extends Notification
{
    use Queueable;

    public function via($notifiable)
    {
        return [ SendinblueMailTemplateChannel::class ];
    }

    public function toMailTemplate($notifiable): TemplateMessage
    {
        $templateId = 1;
        $templateMessage = new TemplateMessage($templateId);
        $templateMessage->attribute('USER_EMAIL', $notifiable->email);
        return $templateMessage;
    }
}

You can also get any V3 SendInBlue API using the built-in getAPI method :

use Mograine\Sendinblue\SendinblueApiEnum;
use Mograine\Sendinblue\Facades\Sendinblue;

// We first get the API we want
$transactionalApi = Sendinblue::getApi(SendinblueApiEnum::TransactionalEmailsApi);

// We can then easily use it, example :
$transactionalApi->deleteBlockedDomain('exampleSendinblueDomain.com');

Be sure to visit the SendinBlue official documentation website for additional information about the API.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

License

license. Please see the license file for more information.

Related Packages

floriankaemo/sendinblue-wrapper

A Laravel 5 wrapper for the SendInBlue API PHP class (as provided by SendInBlue)

160 0
kinow-io/sendinblue-wrapper

A Laravel 5 wrapper for the SendInBlue API PHP class (as provided by SendInBlue)

1,114 1
vansteen/sendinblue

A Laravel 5 (and Laravel 4) wrapper for the SendInBlue API PHP class (as provide...

5,329 3
floriankaemo/sendinblue

A Laravel 5 wrapper for the SendInBlue API PHP class (as provided by SendInBlue)

0 0
kaishiyoku/laravel-sendinblue

Laravel's mail transport for SendinBlue

0 0