aglipanci / interspire
Interspire API Intergration Made Easy
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-10-23 03:18:20 UTC
README
Interspire API Intergration Made Easy
Installation
Add laravel-interspire to your composer.json file:
"require": {
"aglipanci/interspire": "dev-master"
}
Use composer to install this package.
$ composer update
Registering the Package
Register the service provider within the providers
array found in app/config/app.php
:
'providers' => array( // ... 'Aglipanci\Interspire\InterspireServiceProvider', )
Add an alias within the aliases
array found in app/config/app.php
:
'aliases' => array( // ... 'Interspire' => 'Aglipanci\Interspire\Facades\Interspire', )
Configuration
Create configuration file for package using artisan command
$ php artisan config:publish aglipanci/interspire
And edit the config file with your Interspire API URL, Username and Token.
Usage
Basic usage
To add a new Subscriber to a list you should add name, surname, email and the list id (which you get from interspire);
Interspire::addSubscriberToList('John', 'Smith', 'jsmith@gmail.com', 1);
To delete an existing Subscriber you need only the email address:
Interspire::deleteSubscriber('jsmith@gmail.com');
To check if a subscriber is already on a specific list:
Interspire::isOnList('jsmith@gmail.com', 2)