Skip to content

Examples

Seb Kay edited this page Oct 13, 2021 · 4 revisions

Mailchimp

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

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

    $arbalest->subscribe('test@test.com');
} catch (\Exception $e) {
    // Do something on error
}

Campaign Monitor

use Arbalest\Arbalest;
use Arbalest\Services\CampaignMonitor;

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

    $arbalest->subscribe('test@test.com');
} catch (\Exception $e) {
    // Do something on error
}

ConvertKit

use Arbalest\Arbalest;
use Arbalest\Services\ConvertKit;

try {
    $arbalest = new Arbalest(
        new ConvertKit([
            'api_key'     => '12345',
            'api_secret'  => 'abcde',
            'form_id'     => '1ab2c3',
        ])
    );

    $arbalest->subscribe('test@test.com');
} catch (\Exception $e) {
    // Do something on error
}

ActiveCampaign

use Arbalest\Arbalest;
use Arbalest\Services\ActiveCampaign;

try {
    $arbalest = new Arbalest(
        new ActiveCampaign([
            'api_key'     => '12345',
            'account_url' => 'https://<youraccount>.api-us1.com',
            'list_id'     => 1,
        ])
    );

    $arbalest->subscribe('test@test.com');
} catch (\Exception $e) {
    // Do something on error
}

Omnisend

use Arbalest\Arbalest;
use Arbalest\Services\Omnisend;

try {
    $arbalest = new Arbalest(
        new Omnisend([
            'api_key' => '12345',
        ])
    );

    $arbalest->subscribe('test@test.com');
} catch (\Exception $e) {
    // Do something on error
}
Clone this wiki locally