PHP code example of earlhickey / pg-mailchimp

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

    

earlhickey / pg-mailchimp example snippets


    
    return array(
        'modules' => array(
            // ...
            'PgMailchimp',
        ),
        // ...
    );
    

    //  create recipient
    $recipient = new \stdClass();
    $recipient->firstname = 'John';
    $recipient->lastname = 'Doe';
    $recipient->gender = '';
    $recipient->dateOfBirth = '';
    $recipient->email = '[email protected]';

    $subscribe = $this->mailchimp()->subscribe($recipient);
    

    //  create recipient
    $recipient = new \stdClass();
    $recipient->email = '[email protected]';

    $unsubscribe = $this->mailchimp()->unsubscribe($recipient);
    
bash
    $ php composer.phar update