PHP code example of hugofirth / mailchimp

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

    

hugofirth / mailchimp example snippets


'providers' => array(
    …
    'Hugofirth\Mailchimp\MailchimpServiceProvider',
    …
),

'aliases' => array(
    …
    'MailchimpWrapper'       => 'Hugofirth\Mailchimp\Facades\MailchimpWrapper',
    …
),

…
//Retrieve an array of lists for your account
$lists = MailchimpWrapper::lists()->getList()['data'];
…
//Subscribe a user, with email: $email_address, to a list with id: $list_id
MailchimpWrapper::lists()->subscribe($list_id, array('email'=>$email_address));



use Hugofirth\Mailchimp\Facades\MailchimpWrapper;

class SomeClass
{
    public function someMethod()
    {
        MailchimpWrapper:: //You should be able to get auto completion here for the API methods/properties
    }
}
sh
$ php artisan config:publish hugofirth/mailchimp