Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

combindma/laravel-sendinblue

Repository files navigation

Laravel Seninblue

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Manage newsletters in Laravel with Sendinblue

Installation

You can install the package via composer:

composer require combindma/laravel-sendinblue

You can publish the config file with:

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

This is the contents of the published config file:

return [
    /*
   * Enable or disable Sendinblue. Useful for local development when running tests.
   */
    'api_enabled' => env('SENDINBLUE_ENABLED', false),

    /*
     * The API key of a Sendinblue account.
     */
    'apiKey' => env('SENDINBLUE_APIKEY'),

    /*
     * The default Ids of the lists to add the contact to when no listIds has been specified in a method.
     */
    'defaultListIds' => [
        2,
    ]
];

Usage

Subscribing an email address can be done like this:

Sendinblue::subscribe('email@email.com');

You can pass some merge variables as the second argument:

Sendinblue::subscribe('email@email.com', ['FNAME'=>'Rince', 'LNAME'=>'Wind'];

You can subscribe someone to a specific list ID by using the third argument:

Sendinblue::subscribe('email@email.com', ['FNAME'=>'Rince', 'LNAME'=>'Wind'], [2]);

Unsubscribing an email address can be done like this:

Sendinblue::unsubscribe('email@email.com');

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.