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/ */
…
//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
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.