Download the PHP package juanparati/brevosuite without Composer

On this page you can find all versions of the php package juanparati/brevosuite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package brevosuite

Brevo suite for Laravel

What is it?

A complete Brevo suite for Laravel.

It provides the following features

Installation

For Laravel 12.x

  composer require juanparati/brevosuite "^12.0"

For Laravel 11.x

  composer require juanparati/brevosuite "^11.0"

For Laravel 10.x

  composer require juanparati/brevosuite "^10.0"

For older Laravel versions check Sendinblue v3 for Laravel.

  1. Add the following configuration snippet into the "config/services.php" file

     'brevo' => [        
         'key'   => '[your api key]'
     ],
  2. Change the mail driver to "brevo" into the "config/mail.php" file or the ".env" file (Remember that ".env" values will overwrite the config values). Example:

     'driver' => env('MAIL_MAILER', 'brevo'),
    
     'mailers' => [
         // ...
         'brevo' => [
             'transport' => 'brevo'
         ]
         // ...
     ];

Usage

Transactional mail transport

Just use the transactional e-mails using the Laravel Mail facade.

As soon that Brevo was configured as native mail transport you can use the following code in order to test it:

// Paste this code inside "artisan tinker" console.
Mail::raw('Test email', function ($mes) { 
    $mes->to('[[email protected]]'); 
    $mes->subject('Test'); 
});

Transactional mail template transport

The transactional mail template transport allow to send templates as transactional e-mails using Brevo.

It's possible to register the mail template transport facade into the "config/app.php":

    'MailTemplate' => Juanparati\BrevoSuite\Facades\Template::class,

Now it's possible to send templates in the following way:

    MailTemplate::to('[email protected]');           // Recipient
    MailTemplate::cc('[email protected]');          // CC
    MailTemplate::bcc('[email protected]');         // BCC
    MailTemplate::replyTo('[email protected]');      // ReplyTo
    MailTemplate::attribute('NAME', 'Mr User');     // Replace %NAME% placeholder into the template 
    MailTemplate::attach('file.txt');               // Attach file
    MailTemplate::attachURL('http://www.example.com/file.txt'); // Attach file from URL
    MailTemplate::send(100);                        // Send template ID 100 and return message ID in case of success

It's possible to reset the template message using the "reset" method:

    MailTemplate::to('[email protected]');           // Recipient
    MailTemplate::cc('[email protected]');          // Second recipient
    MailTemplate::attribute('TYPE', 'Invoice');     // Replace %TYPE% placeholder
    MailTemplate::send(100);                        // Send template

    MailTemplate::to('[email protected]');          // Another recipient
    MailTemplate::send(100);                        // Send template but attribute "type" and second recipient from previous e-mail is used

    MailTemplate::reset();                          // Reset message

    MailTemplate::to('[email protected]');          
    MailTemplate::send(100);                        // Send template but previous attribute and second recipient is not used.

It's also possible enclose the mail message into a closure so the call to the "reset" method is not necessary:

    MailTemplate::send(100, function ($message) {
        $message->to('[email protected]');

        // Note: Your template should contains the placeholder attributes surrounded by "%" symbol.
        // @see: https://help.brevo.com/hc/en-us/articles/360000268730-How-to-customize-your-transactional-emails
        $message->attributes(['placeholder1' => 'one', 'placeholder2' => 'two']);
        ...
    });        

Transactional SMS

The transactional SMS allow to send SMS using the Brevo SMS transport.

I's possible to register the SMS transport facade into the "config/app.php":

    'SMS' => Juanparati\BrevoSuite\Facades\Sms::class,

Usage examples:

    SMS::sender('TheBoss');         // Sender name (Spaces and symbols are not allowed)
    SMS::to('45123123123');         // Mobile number with internal code (ES)
    SMS::message('Come to work!');  // SMS message
    SMS::tag('lazydev');            // Tag (Optional)
    SMS::webUrl('http://example.com/endpoint'); // Notification webhook (Optional);
    SMS::send();

Like the transactional template transport, it is also possible reset the state using the "reset" method or just using a closure:

    SMS::send(function($sms) {
        $sms->to('45123123123');
        $sms->sender('Mr Foo');
        $sms->message('Hello Mr Bar');
        ...
    });

Laravel notifications

The following classes are provided as message builder for Laravel notifications:

API Client

By default, this library uses the official GetBrevo PHP library.

In order to interact with the official library it's possible to inject the custom APIs in the following way:

    // Obtain APIClient
    $apliClient = app()->make(\Juanparati\BrevoSuite\Client::class);

    // Use the APIClient with the Brevo ContactsAPI
    $contactsApi = $apliClient->getApi('ContactsApi');

    // Retrieve the first 10 folders
    $folders = $contactsApi->getFolders(10, 0);  

Another example using Sendinblue models:

    $apiClient = app()->make(\Juanparati\BrevoSuite\Client::class);
    $contactsApi = $apiClient->getApi('ContactsApi');

    // Use CreateContact model
    $contact = $apiClient->getModel('CreateContact', ['email' => '[email protected]', 'attributes' => ['TYPE' => 4, 'NOM' => 'test', 'PRENOM' => 'test'], 'listIds' => [22]]);

    try {
        $contactsApi->createContact($contact);
    }
    catch(\Exception $e){
        dd($e->getMessage());
    }

See the GetBrevo PHP library for more details.

Supported by

This project was made possible by Matchbanker.no.


All versions of brevosuite with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
laravel/framework Version ^12.0.0
illuminate/mail Version ^12.0.0
getbrevo/brevo-php Version ~v2.0
symfony/brevo-mailer Version ~7.0.3
symfony/http-client Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package juanparati/brevosuite contains the following files

Loading the files please wait ....