https://github.com/lorddashme/php-mailchimp
A PHP package wrapper for MailChimp API.
https://github.com/lorddashme/php-mailchimp
api mail mailchimp mailchimp-api marketing php
Last synced: about 1 year ago
JSON representation
A PHP package wrapper for MailChimp API.
- Host: GitHub
- URL: https://github.com/lorddashme/php-mailchimp
- Owner: LordDashMe
- License: mit
- Created: 2017-08-23T11:01:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-01T16:11:01.000Z (about 3 years ago)
- Last Synced: 2025-03-20T04:44:16.388Z (over 1 year ago)
- Topics: api, mail, mailchimp, mailchimp-api, marketing, php
- Language: PHP
- Homepage:
- Size: 184 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP MailChimp
A PHP package wrapper for MailChimp API.
This package support only the version 3 of Mailchimp API.
[](https://packagist.org/packages/LordDashMe/php-mailchimp) [](https://php.net/) [](https://coveralls.io/github/LordDashMe/php-mailchimp?branch=master)
## Requirement(s)
- PHP version from 5.6.* up to latest.
## Install
- It is advice to install the package via Composer. Use the command below to install the package:
```txt
composer require lorddashme/php-mailchimp
```
## Usage
- Below are the available functions:
| Function | Description |
| -------- | ----------- |
|
|
|
| ```post('route', closure/array);``` | To request in the MailChimp API service using POST method. The body parameter accepts Cloure or Array type. |
| ```get('route');``` | To request in the MailChimp API service using GET method. |
| ```patch('route', closure/array);``` | To request in the MailChimp API service using PATCH method. The body parameter accepts Cloure or Array type. |
| ```delete('route');``` | To request in the MailChimp API service using DELETE method. |
| ```action('route');``` | To request in the MailChimp API service using the custom ACTION. |
| ```getRequest();``` | To check the current request details. Can be use for debugging purposes. |
| ```getRespose();``` | To get the current response from the MailChimp API service.
Response Format:
```{"response_body": {...}", "header": {"response_http_code": ...}}``` |
- Basic usage:
```php
post("list/{$listId}/members", function ($requestBody) {
$requestBody->email_address = 'sample_email@mailchimp.com';
return $requestBody;
});
// If you want to investigate the current request details.
$mailchimp->getRequest();
// To get the response from the MailChimp API service.
// Response: {"response_body": {...}", "header": {"response_http_code": ...}}
$response = $mailchimp->getResponse();
```
- Also can be done by using the below code:
```php
'sample_email@mailchimp.com'
));
MailChimp::getRequest();
// Response: {"response_body": {...}", "header": {"response_http_code": ...}}
$response = MailChimp::getResponse();
```
## License
This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).