Thank you for taking the time to help us develop the MailChimp library!
We do all our work on GitHub. If you'd like to help, you can create a free GitHub account here.
For bug reports or feature requests, please create a new issue.
If reporting a bug, please:
- Let us know what steps we can take to reproduce the bug
- Include any error messages you received
The best way to submit a bug fix or improvement is through a pull request.
- Fork, then clone the repository:
git clone [email protected]:YOUR-GITHUB-USERNAME/mailchimp-api-php.git
- Install the library's dependencies using Composer:
cd mailchimp-api-php
composer install
-
If you are adding new functionality, please add a corresponding test. See Testing for more information.
-
After making your changes, ensure all tests pass.
-
Commit and push your changes to your fork of the repository.
This library includes a PHPUnit test suite. Keeping these tests up to date helps us ensure the library is reliable.
Add Composer's vendor directory to your PATH by adding the following line to your profile. This is dependent on your system, but on a Linux or Mac OSX system using Bash, you'll typically find the file at ~/.bash_profile.
export PATH="./vendor/bin:$PATH"
Bash example:
echo 'export PATH="./vendor/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
Then run PHPUnit:
phpunit
Tests are located in the tests directory and are grouped into PHP files named after the library component they are testing. For example, MailchimpCampaignsTest.php contains tests for MailChimp Campaigns.
New tests should contain at least the functionality in this simple test:
public function testGetCampaigns() {
$mc = new MailchimpCampaigns();
$mc->getCampaigns();
$this->assertEquals('GET', $mc->getClient()->method);
$this->assertEquals($mc->getEndpoint() . '/campaigns', $mc->getClient()->uri);
}
This test checks the request type and request URI are both correct.
More advanced examples can be found in the tests directory.
- MailChimp API documentation
- MailChimp Drupal module, MailChimp integration for Drupal using this library.
- MailChimp E-Commerce Drupal module, MailChimp integration for Drupal Commerce using this library.
- ThinkShout, the library maintainer.
We're hiring software engineers! Check out our careers page.