PHP code example of bkuhl / easychimp

1. Go to this page and download the library: Download bkuhl/easychimp 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/ */

    

bkuhl / easychimp example snippets


$easychimp = new Easychimp\Easychimp($apiKey);
$easychimp->validateKey(); // throws InvalidApiKey
$list = $easychimp->mailingList($listId);

$list->exists(); // boolean
$list->isOnList($email); // boolean
$list->subscribe($email, $firstName = null, $lastName = null, ...); // boolean
$list->unsubscribe($email); // boolean
$list->subscriberInfo($email); // []
$list->updateSubscriber($email, $firstName = null, $lastName = null, ...); // boolean

// Interests are labeled as "Groups" in the Mailchimp UI
$list->interestCategories(); // []
$list->interests($interestCategoryId); // []

'aliases' => [
    ...
    'Easychimp' => Easychimp\MailchimpFacade::class,
]