desher/expertsender-api

This package is abandoned and no longer maintained. The author suggests using the expertsender-api package instead.

ExpertSender API client

0.0.4 2016-12-09 09:18 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:54:43 UTC


README

PHP client for ExpertSender API

Usage

$expertSender = new ExpertSenderApi($apiKey);

# create new list
$list = new mappers\SubscribersList();
$list->name = 'Test list';
$listId = $expertSender->getLists()->createList($list);

# create new subscriber in list
$subscriber = new mappers\Subscriber('subscriber@email.com');
$subscriber
        ->setFirstname('Tester')
        ->addProperty(1, mappers\Property::TYPE_BOOLEAN, true);

$success = $expertSender->getSubscribers()->save($subscriber, $listId);

if ($success) {
    $subscriber = $expertSender->getSubscribers()->get('subscriber@email.com');

    # save additional data to table
    $expertSender->getTables()->addRow('orders', [
        'subscriber_id' => $subscriber->getId(),
        'product_id' => $productId,
    ]);
}