Skip to content

Commit

Permalink
Update for official release
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Jul 30, 2013
1 parent 8a7cb8c commit 114726a
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 105 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CHANGELOG

## 1.0.0-beta3
## 1.0.0

* Add list static segment

Expand Down
172 changes: 93 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The following methods are supported by the client (not everything has been caref

## Integration with frameworks

To make this library even more easier to use, here are various libraries:
To make this library even more easier to use, here are various frameworks integrations:

* [ZfrMailChimpModule](https://github.com/zf-fr/zfr-mailchimp-module): this is a Zend Framework 2 module

Expand All @@ -40,20 +40,18 @@ Want to do an integration for another framework? Open an issue, and I'll open a
We recommend you to use Composer to install ZfrMailChimp:

```sh
php composer.phar require zfr/zfr-mailchimp:dev-master
php composer.phar require zfr/zfr-mailchimp:1.*
```

Then, update your dependencies by typing: `php composer.phar update`.

## Tutorial

Instantiate the MailChimp client:
Firstly, you need to instantiate the MailChimp client:

```php
$client = new MailChimpClient('my-api-key');
```

The correct endpoint will be selected based on your API key.
The correct endpoint will be automatically chosen based on your API key.

You can then have access to all the methods available (see the list below):

Expand All @@ -73,10 +71,10 @@ $client->addFolder(array(
### How to use it ?

You will notice that the method names below does not always have a 1-to-1 mapping with the API names. For instance,
most method that imply retrieving are prefixed by "get".
most method that imply retrieving something are prefixed by "get".

However, there is an exact mapping for parameters. For instance, let's take the subscribe method. The [documentation](http://apidocs.mailchimp.com/api/2.0/lists/subscribe.php)
describes the list of parameters:
However, there is an exact mapping for parameters. Therefore, you just need to refer to the official documentation
for a given method (links are given below). Here is an example with the [subscribe](http://apidocs.mailchimp.com/api/2.0/lists/subscribe.php) method:

```php
$client->subscribe(array(
Expand All @@ -94,94 +92,110 @@ Here are the supported methods today:

CAMPAIGN RELATED METHODS:

* array createCampaign(array $args = array())
* array deleteCampaign(array $args = array())
* array getCampaignContent(array $args = array())
* array getCampaigns(array $args = array())
* array getTemplateContent(array $args = array())
* array pauseCampaign(array $args = array())
* array replicateCampaign(array $args = array())
* array resumeCampaign(array $args = array())
* array scheduleCampaign(array $args = array())
* array scheduleBatchCampaign(array $args = array())
* array sendCampaign(array $args = array())
* array sendTestCampaign(array $args = array())
* array testSegmentation(array $args = array())
* array unscheduleCampaign(array $args = array())
* array updateCampaign(array $args = array())
* array createCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/create.php)
* array deleteCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/delete.php)
* array getCampaignContent(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/content.php)
* array getCampaigns(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/list.php)
* array getTemplateContent(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/template-content.php)
* array pauseCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/pause.php)
* array replicateCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/replicate.php)
* array resumeCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/resume.php)
* array scheduleCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/schedule.php)
* array scheduleBatchCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/schedule-batch.php)
* array sendCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/send.php)
* array sendTestCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/send-test.php)
* array testSegmentation(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/segment-test.php)
* array unscheduleCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/unschedule.php)
* array updateCampaign(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/campaigns/update.php)

LIST RELATED METHODS:

* array addInterestGroup(array $args = array())
* array addInterestGrouping(array $args = array())
* array addListMergeVar(array $args = array())
* array addListWebhook(array $args = array())
* array batchSubscribe(array $args = array())
* array batchUnsubscribe(array $args = array())
* array deleteInterestGroup(array $args = array())
* array deleteInterestGrouping(array $args = array())
* array deleteListWebhook(array $args = array())
* array deleteListMergeVar(array $args = array())
* array getAbuseReports(array $args = array())
* array getInterestGroupings(array $args = array())
* array getListActivity(array $args = array())
* array getListClients(array $args = array())
* array getListGrowthHistory(array $args = array())
* array getListMergeVars(array $args = array())
* array getListStaticSegments(array $args = array())
* array getLists(array $args = array())
* array getListLocations(array $args = array())
* array getListMembers(array $args = array())
* array getListMembersActivity(array $args = array())
* array getListMembersInfo(array $args = array())
* array getListWebhooks(array $args = array())
* array resetListMergeVar(array $args = array())
* array setListMergeVar(array $args = array())
* array subscribe(array $args = array())
* array unsubscribe(array $args = array())
* array updateInterestGroup(array $args = array())
* array updateInterestGrouping(array $args = array())
* array updateListMember(array $args = array())
* array addInterestGroup(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-group-add.php)
* array addInterestGrouping(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-grouping-add.php)
* array addListMergeVar(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/merge-var-add.php)
* array addListWebhook(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/webhook-add.php)
* array batchSubscribe(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/batch-subscribe.php)
* array batchUnsubscribe(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/batch-unsubscribe.php)
* array deleteInterestGroup(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-group-del.php)
* array deleteInterestGrouping(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-grouping-del.php)
* array deleteListMergeVar(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/merge-var-del.php)
* array deleteListWebhook(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/webhook-del.php)
* array getAbuseReports(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/abuse-reports.php)
* array getInterestGroupings(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-groupings.php)
* array getListActivity(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/activity.php)
* array getListClients(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/clients.php)
* array getListGrowthHistory(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/growth-history.php)
* array getListMergeVars(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/merge-vars.php)
* array getLists(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/list.php)
* array getListLocations(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/locations.php)
* array getListMembers(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/members.php)
* array getListMembersActivity(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/member-activity.php)
* array getListMembersInfo(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/member-info.php)
* array getListStaticSegments(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/static-segments.php)
* array getListWebhooks(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/webhooks.php)
* array resetListMergeVar(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/merge-var-reset.php)
* array setListMergeVar(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/merge-var-set.php)
* array subscribe(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/subscribe.php)
* array unsubscribe(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/unsubscribe.php)
* array updateInterestGroup(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-group-update.php)
* array updateInterestGrouping(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-grouping-update.php)
* array updateListMember(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/update-member.php)

ECOMM RELATED METHODS:

* array addOrder(array $args = array())
* array deleteOrder(array $args = array())
* array getOrders(array $args = array())
* array addOrder(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/ecomm/order-add.php)
* array deleteOrder(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/ecomm/order-del.php)
* array getOrders(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/ecomm/orders.php)

FOLDER RELATED METHODS:

* array addFolder(array $args = array())
* array deleteFolder(array $args = array())
* array getFolders(array $args = array())
* array updateFolders(array $args = array())
* array addFolder(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/folders/add.php)
* array deleteFolder(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/folders/del.php)
* array getFolders(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/folders/list.php)
* array updateFolders(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/folders/update.php)

TEMPLATE RELATED METHODS:

* array addTemplate(array $args = array())
* array deleteTemplate(array $args = array())
* array getTemplateInfo(array $args = array())
* array getTemplates(array $args = array())
* array undeleteTemplate(array $args = array())
* array updateTemplate(array $args = array())
* array addTemplate(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/templates/add.php)
* array deleteTemplate(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/templates/del.php)
* array getTemplateInfo(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/templates/info.php)
* array getTemplates(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/templates/list.php)
* array undeleteTemplate(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/templates/undel.php)
* array updateTemplate(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/templates/update.php)

USERS RELATED METHODS:

* array inviteUser(array $args = array())
* array getInvitations(array $args = array())
* array getLogins(array $args = array())
* array reinviteUser(array $args = array())
* array revokeLogin(array $args = array())
* array revokeUserInvitation(array $args = array())
* array inviteUser(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/invite.php)
* array getInvitations(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/invites.php)
* array getLogins(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/logins.php)
* array reinviteUser(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/invite-resend.php)
* array revokeLogin(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/login-revoke.php)
* array revokeUserInvitation(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/invite-revoke.php)

VIP RELATED METHODS:

* array addVipMembers(array $args = array())
* array deleteVipMembers(array $args = array())
* array getVipMembers(array $args = array())
* array getVipActivity(array $args = array())
* array addVipMembers(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/vip/add.php)
* array deleteVipMembers(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/vip/del.php)
* array getVipMembers(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/vip/members.php)
* array getVipActivity(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/vip/activity.php)

HELPER RELATED METHODS:

* array getAccountDetails(array $args = array())
* array ping(array $args = array())
* array getAccountDetails(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/helper/account-details.php)
* array ping(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/helper/ping.php)

## Advanced usage

### Attaching Guzzle plugins

Because ZfrMailChimp is built on top of Guzzle, you can take advantage of all the nice features of it. For instance,
let's say you want to send requests asynchronously, you can simply attach the built-in Async plugin:

```php
use ZfrMailChimp\Client\MailChimpClient;
use Guzzle\Plugin\Async\AsyncPlugin;

$client = new MailChimpClient('my-secret-key');
$client->addSubscriber(new AsyncPlugin());
$response = $client->get()->send();
```
2 changes: 1 addition & 1 deletion src/ZfrMailChimp/Client/MailChimpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
* @method array getListClients(array $args = array()) {@command MailChimp GetListClients}
* @method array getListGrowthHistory(array $args = array()) {@command MailChimp GetListGrowthHistory}
* @method array getListMergeVars(array $args = array()) {@command MailChimp GetListMergeVars}
* @method array getListStaticSegments(array $args = array()) {@command MailChimp GetListStaticSegments}
* @method array getLists(array $args = array()) {@command MailChimp GetLists}
* @method array getListLocations(array $args = array()) {@command MailChimp GetListLocations}
* @method array getListMembers(array $args = array()) {@command MailChimp GetListMembers}
* @method array getListMembersActivity(array $args = array()) {@command MailChimp GetListMembersActivity}
* @method array getListMembersInfo(array $args = array()) {@command MailChimp GetListMembersInfo}
* @method array getListStaticSegments(array $args = array()) {@command MailChimp GetListStaticSegments}
* @method array getListWebhooks(array $args = array()) {@command MailChimp GetListWebhooks}
* @method array resetListMergeVar(array $args = array()) {@command MailChimp ResetListMergeVar}
* @method array setListMergeVar(array $args = array()) {@command MailChimp SetListMergeVar}
Expand Down
Loading

0 comments on commit 114726a

Please sign in to comment.