Here is some steps for integrating mailchimp in CI application:
- Download below file and put it into apllication/library folder.
- Download Mailchimp library
- Add below code in controller file:
$config['Mailchimp_api_key'] = 'XXXXXXXXXXXXXXXXXXXXXX-XXXX';
$this->load->library('MailChimp', $config);
$list_id = 'XXXXXXXXX';
$result = $this->mailchimp->post("lists/$list_id/members", [
'email_address' => 'parth@techcompose.com',
'merge_fields' => ['FNAME'=>'Parth', 'LNAME'=>'Shah'],
'status' => 'subscribed',
]);
echo '<pre>';
print_r($result);exit;
- You can find list_id from – Lists > Settings > List Name and defaults.

