arungpisyadi / sibex
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.
Requires
- illuminate/support: ~5|~6|~7|~8
- sendinblue/api-v3-sdk: ^7.1
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3|~4|~5|~6
- phpunit/phpunit: ~8.0|~9.0
- sempro/phpunit-pretty-print: ^1.0
This package is auto-updated.
Last update: 2024-11-10 03:36:15 UTC
README
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.