PHPackages                             mmollick/drip-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. mmollick/drip-php

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

mmollick/drip-php
=================

Community supported library for Drip.com's API

v0.1.1(8y ago)310.9k↓42.9%1MITPHPPHP &gt;=5.6.0

Since Feb 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/mmollick/drip-php)[ Packagist](https://packagist.org/packages/mmollick/drip-php)[ RSS](/packages/mmollick-drip-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Drip PHP API Wrapper
====================

[](#drip-php-api-wrapper)

[![Build Status](https://camo.githubusercontent.com/bdb09f62446b4b6c705460da537e80d1d8d70c861086770f2791a9b19fc19a55/68747470733a2f2f7472617669732d63692e6f72672f6d6d6f6c6c69636b2f647269702d7068702e737667)](https://travis-ci.org/mmollick/drip-php)[![](https://camo.githubusercontent.com/4d9cd3fcb19896a3dc5c10df2a0e649ed0ade4ff1121bbd6d7fd24b4308cbf3b/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f64386462663539646163636366333761316337372f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/mmollick/drip-php/maintainability)[![](https://camo.githubusercontent.com/b8de5decc9a790f22f98833a84c566de5c4000f703a8048fd0a5f332d20d0f33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6d6f6c6c69636b2f647269702d7068702e737667)](https://packagist.org/packages/mmollick/drip-php)[![](https://camo.githubusercontent.com/1cbebc1e66be9051d44429ccad04691cf9581e1a235b695f23efcd1fe3d0fe70/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d6d6f6c6c69636b2f647269702d7068702e737667)](https://packagist.org/packages/mmollick/drip-php)

### Requirements

[](#requirements)

- PHP 5.6 or greater
- PHP JSON extension
- PHP cURL extension

Installation
------------

[](#installation)

### Composer Installation

[](#composer-installation)

Run the following command in the terminal:

```
composer require mmollick/drip-php
```

Or add the following to your `composer.json` file:

```
{
  "require": {
    "mmollick/drip-php":"~0.1.0"
  }
}
```

### Manual Installation

[](#manual-installation)

This package conforms to the PSR-4 autoloading standard. To include it in your project we recommend using composer, however you can use your own PSR-4 autoloader or manually load all the files contained in the `src` directory to load this library.

Usage
-----

[](#usage)

This package allows you use it in both an object-oriented or singleton approach depending on your preferences. All authentication and request methods are available with either approach.

### Initialization as Singleton

[](#initialization-as-singleton)

Specify your authentication credentials with either the `setTokenCredentials` or `setOAuthAccessToken` static methods on the Drip class.

```
// Authenticating w/ API key
\MMollick\Drip\Drip::setTokenCredentials($accountId, $api_key)

// Authenticating w/ OAuth access_token
\MMollick\Drip\Drip::setOAuthAccessToken($accountId, $access_token)
```

### Initialization as Object

[](#initialization-as-object)

Using the object-oriented approach allows you to create multiple isolated instances of the Drip API. To do this first create new a `\MMollick\Drip\Auth` object and pass this into a new `\MMollick\Drip\Request` object.

```
// Authentication w/ API Key
$auth = new \MMollick\Drip\Auth($account_id, $api_key);
$drip = new \MMollick\Drip\Request($auth);

// Authentication w/ OAuth access_token
$authUsingOauth = new \MMollick\Drip\Auth($account_id, $access_token, true);
$dripUsingOauth = new \MMollick\Drip\Request($authUsingOauth);
```

### Error Handling

[](#error-handling)

This library will throw one of several exceptions when an error occurs either with the Request or the package itself. It's recommended that requests are made within in a `try...catch` block to properly handle errors as they arise. See the example below.

```
try {
    $drip->getSubscribers();
}
catch (\MMollick\Drip\Errors\AuthException $e) {
    // Authentication failed, check API keys
}
catch (\MMollick\Drip\Errors\ValidationException $e) {
    //The request failed validation, see message or $e->getErrors() for more info
}
catch (\MMollick\Drip\Errors\ApiExceptions $e) {
    // Non-specific API error returned, see message or $e->getErrors() for more info
}
catch (\MMollick\Drip\Errors\RateLimitException $e) {
    // Requests are being throttled, try the request again in a while
}
catch (\MMollick\Drip\Errors\HttpClientException $e) {
    // Most likely a network or Curl related error, see the message for more details
}
catch (\MMollick\Drip\Errors\GeneralException $e) {
    // A generic exception, see message for details
}
catch (\Exception $e) {
    // Catch anything else just for good measure
}
```

### Methods

[](#methods)

All of the request methods can be accessed statically from the `\MMollick\Drip\Drip` class or by calling them from the `\MMollick\Drip\Request` object.

##### Account

[](#account)

ActionsMethodsList accounts`getAccounts()`Fetch an account`getAccount($account_id)`##### Broadcasts

[](#broadcasts)

ActionsMethodsList broadcasts`getBroadcasts($options = [])`Fetch a broadcast`getBroadcast($broadcast_id)`##### Campaigns

[](#campaigns)

ActionsRequest MethodsList campaigns`getCampaigns($options = [])`Fetch a campaign`getCampaign($campaign_id)`Activate a campaign`activateCampaign($campaign_id)`Pause a campaign`pauseCampaign($campaign_id)`List campaign subscribers`listCampaignSubscribers($campaign_id, $options = [])`Subscribe to a campaign`subscribeToCampaign($campaign_id, $subscriber)`##### Campaign Subscriptions

[](#campaign-subscriptions)

ActionsMethodsList subscriber's subscriptionsSee `listSubscribersSubscriptions` in Subscribers##### Conversions

[](#conversions)

ActionsMethodsList all conversions`getConversions($options = [])`Fetch a conversion`getConversion($conversion_id)`##### Custom Fields

[](#custom-fields)

ActionsMethodsList all custom fields`getCustomFields()`##### Events

[](#events)

ActionsMethodsTrack an event`recordEvent($payload)`Track a batch of events`recordEvents($events)`List all custom event actions`listActions()`##### Forms

[](#forms)

ActionsMethodsList all forms`getForms($options = [])`Fetch a form`getForm($form_id)`##### Purchases

[](#purchases)

ActionsMethodsList purchases for a subscriber`getPurchasesForSubscriber($id_or_email, $options = [])`Create a purchase`addPurchaseToSubscriber($id_or_email, $purchase_id)`Fetch a purchase`getPurchaseForSubscriber($id_or_email, $payload)`##### Subscribers

[](#subscribers)

ActionsMethodsList subscribers`getSubscribers($options = [])`Create/update a subscriber`createOrUpdateSubscriber($email, $payload = {})`Create/update a batch of subscribers`createOrUpdateSubscribers($subscribers)`Unsubscribe a batch of subscribers`unsubscribeSubscribers($subscribers)`Fetch a subscriber`getSubscriber($id_or_email)`Delete`deleteSubscriber($id_or_email)`Subscribe to a campaignSee `subscribeToCampaign` in CampaignsUnsubscribe from all mailings`removeSubscriberFromAllMailings($id_or_email)`Unsubscribe from campaigns`removeSubscriberFromCampaigns($id_or_email, $campaign_id = null)`List subscriber's subscriptions`listSubscribersSubscriptions($subscriber_id)`##### Tags

[](#tags)

ActionsMethodsList tags`getTags()`Apply a tag`applyTag($email, $tag)`Remove a tag`removeTag($email, $tag)`##### Webhooks

[](#webhooks)

ActionsMethodsList webhooks`getWebhooks()`Fetch a webhook`getWebhook($webhook_id)`Create a new webhook`createWebhook($payload)`Delete a webhook`deleteWebhook($webhook_id)`##### Workflows

[](#workflows)

ActionsMethodsList workflows`getWorkflows($options = [])`Fetch a workflow`getWorkflow($workflow_id)`Activate a workflow`activateWorkflow($workflow_id)`Pause a workflow`pauseWorkflow($workflow_id)`Start a subscriber on a workflow`addSubscriberToWorkflow($workflow_id, $options = [])`Remove a subscriber from a workflow`removeSubscriberFromWorkflow($workflow_id, $id_or_email)`##### Workflow Triggers

[](#workflow-triggers)

ActionsMethodsList workflow triggers`getWorkflowTriggers($workflow_id)`Create a workflow trigger`createWorkflowTrigger($workflow_id, $options = [])`Update a workflow trigger`updateWorkflowTrigger($workflow_id, $options = [])`Contributing
------------

[](#contributing)

1. Fork it (  )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
    - Add tests when relevant
    - If you add a new method to the Request class or the Request traits be sure to include the static declaration in Drip.php's phpdoc
4. Push to the branch (git push origin my-new-feature)
    - Fix linting issues Code-Climate Identifies
5. Create a new Pull Request

Support
-------

[](#support)

This package is open-source and maintained by the community. Drip does not directly participate in the maintenance of this package. Any issues with this package should be addressed by [opening a new issue](https://github.com/mmollick/drip-php/issues/new).

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

2

Last Release

3062d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a496f38f8f0b705dee1b085663c33363b8f49e62b56bed4a07a89c46afb2f9fa?d=identicon)[mmollick](/maintainers/mmollick)

---

Top Contributors

[![mmollick](https://avatars.githubusercontent.com/u/2349344?v=4)](https://github.com/mmollick "mmollick (18 commits)")

---

Tags

apisdkemailwrapperdrip

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mmollick-drip-php/health.svg)

```
[![Health](https://phpackages.com/badges/mmollick-drip-php/health.svg)](https://phpackages.com/packages/mmollick-drip-php)
```

###  Alternatives

[ecomailcz/ecomail

Ecomail.cz API Wrapper

17418.3k4](/packages/ecomailcz-ecomail)[hafael/azure-mailer-driver

Supercharge your Laravel or Symfony app with Microsoft Azure Communication Services (ACS)! Effortlessly add email, chat, voice, video, and telephony-over-IP for next-level communication. 🚀

15130.8k](/packages/hafael-azure-mailer-driver)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
