A more straight forward package to use SendinBlue API V3 in Laravel environment (Ex : Express Solution). The package will enable you to handle SendInBlue various functions through Laravel Facade, mostly related to building email list and managing marketing campaign.

v0.0.4 2020-10-09 18:28 UTC

This package is auto-updated.

Last update: 2024-11-10 03:36:15 UTC


README

Latest Version on Packagist Total Downloads

A more straight forward package to use SendinBlue API V3 in Laravel environment (Ex : Express Solution). The package will enable you to handle SendInBlue various functions through Laravel Facade, mostly related to building email list and managing marketing campaign.

Requirements

  • PHP 7 and later
  • Laravel 5.8+

Installation

Via Composer

$ composer require arungpisyadi/sibex

Basic Usage

<?php
use ArungPIsyadi\SiBex\SiBex;

// These values is better kept save on .env file.
$sibex = new SiBex(SIB_API_TYPE, SIB_API_KEY); // either "api-key" or "partner-key", your SendInBlue API key.

# Account function.
dump($account = $sibex->getAccount());
dump('email: '.$account['email']); // there are other return parameters that you can check your self.

# Contact function.
// get your lists
dump($sibex->getLists($limit, $offset));

// create a new list.
dump($this->sibex->createList());

// add a new email address as our contact in SendInBlue.
$request->email = 'test+temp01@example.com';
dump($sibex->createContact($request->email));

// add a contact based on email to a certain list.
$added = $sibex->addContactToList($list_id, $emails); // $list_id must be an integer, $emails is a separated by comma string.
dump($added);

//Get contacts from a list.
$contacts = $sibex->getContactsFromList($list_id);
dump($contacts);
?>

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email isyadiarung@gmail.com instead of using the issue tracker.

Credits

License

GNU. Please see the license file for more information.