PHP code example of sebkay / arbalest

1. Go to this page and download the library: Download sebkay/arbalest library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sebkay / arbalest example snippets


// Single
$arbalest->subscribe('[email protected]');

$arbalest->unsubscribe('[email protected]');

// Multiple
$arbalest->subscribeAll([
    '[email protected]',
    '[email protected]',
    '[email protected]',
]);

$arbalest->unsubscribeAll([
    '[email protected]',
    '[email protected]',
    '[email protected]',
]);

use Arbalest\Arbalest;
use Arbalest\Services\Mailchimp;

try {
    $arbalest = new Arbalest(
        new Mailchimp([
            'api_key'  => '12345',
            'server'   => 'us2',
            'list_id'  => 'abcde',
        ])
    );

    $arbalest->subscribe('[email protected]');
} catch (\Exception $e) {
    // Do something on error
}