Download the PHP package nblakefriend/mailchimp-apiv3 without Composer
On this page you can find all versions of the php package nblakefriend/mailchimp-apiv3. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nblakefriend/mailchimp-apiv3
More information about nblakefriend/mailchimp-apiv3
Files in nblakefriend/mailchimp-apiv3
Package mailchimp-apiv3
Short Description Complete PHP Wrapper for MailChimp API v3.0.
License MIT
Homepage https://github.com/nblakefriend/MailChimp-API3.0-Wrapper.git
Informations about the package mailchimp-apiv3
MailChimp API v3.0 PHP Wrapper
DEPRECATED:
This project is no longer maintained and is honestly not good. MC offers official 3.0 libraries now: mailchimp.com/developer
PHP wrapper for the MailChimp API v 3.0.
Dependencies
- GuzzleHttp
- PHP > 5.4
Project still in the works. More documentation to come
Installing
Using Composer: composer require nblakefriend/mailchimp-apiv3
Getting Started
When downloading from composer (recommended):
- In
vendor/nblakefriend/mailchimp-apiv3/src
createconfig.ini
file with structure:
Multiple accounts can be configured in this config file.
Whichever key[active] is true will be used.
config.ini is excluded in the .gitignore file. Make sure this is not changed!
- Instantiate with
$mc = new MailChimp\MailChimp
; print_r($mc->getAccountInfo());
should return the MailChimp API Root call.
If downloading this repo directly:
- From your command line, navigate to the MailChimp folder and run
composer update
to download Dependencies. - Add the package to your add
require_once 'MailChimp/vendor/autoload.php'
in your file. - Instantiate with
$mc = new MailChimp\MailChimp
; print_r($mc->getAccountInfo());
should return the MailChimp API Root call.
Using the Wrapper
Each MailChimp collections (lists, campaigns, e-commerce etc.) is accessed using a method found at the bottom of the MailChimp.php
file that instantiates the collection's class.
For example:
Assuming your MailChimp instance is stored in the $mc
variable
Lists
$mc->lists()->getLists();
This would return the response from calling /lists http://developer.mailchimp.com/documentation/mailchimp/reference/lists/#read-get_lists
E-commerce
Adding a new store customer:
$mc->ecommerce()->customers()->addCustomer("STORE123", "CUST123", "[email protected]", true);
This would create a new customer to the store with id STORE123
with the customer id CUST123
and the email address [email protected]
and an opt-in status of true which subscribes the customer to the list.
Collection Reference
- authorizedApps()
- automations()
- batchOps()
- campaignFolders()
- campaigns()
- conversations()
- ecommerce()
-
- ecommerce()->carts()
-
- ecommerce()->customers()
-
- ecommerce()->orders()
-
- ecommerce()->products()
- fileManager()
- lists()
- reports()
- templateFolders()
- templates()
See complete list of available methods for each class/collection here
Docs also able to be run locally from the docs/index.html