PHPackages                             goran-popovic/email-octopus-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. goran-popovic/email-octopus-php

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

goran-popovic/email-octopus-php
===============================

Email Octopus SDK for PHP

v1.0.4(1y ago)527.5k↑35.7%13MITPHPPHP ^7.2.5|^8.0

Since Jan 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/goran-popovic/email-octopus-php)[ Packagist](https://packagist.org/packages/goran-popovic/email-octopus-php)[ Docs](https://github.com/goran-popovic/email-octopus-php)[ RSS](/packages/goran-popovic-email-octopus-php/feed)WikiDiscussions main Synced yesterday

READMEChangelog (4)Dependencies (2)Versions (9)Used By (3)

Email Octopus SDK for PHP
=========================

[](#email-octopus-sdk-for-php)

Email Octopus SDK for PHP is a PHP API client that allows you to interact with the API provided by Email Octopus. Using the package you can easily subscribe/unsubscribe users to your newsletter, trigger automations and view various data about your campaigns.

PHP Version Support
-------------------

[](#php-version-support)

- &gt;= 7.2.5

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

[](#installation)

You can install the package via composer:

```
composer require goran-popovic/email-octopus-php
```

Getting Started
---------------

[](#getting-started)

### API key

[](#api-key)

Before being able to use the SDK, you would need to create an [Email Octopus API key](https://help.emailoctopus.com/article/165-how-to-create-and-delete-api-keys).

### .env settings

[](#env-settings)

After creating the key, you could edit any `.env` file you might be using and add your API key there, for example:

```
EMAIL_OCTOPUS_API_KEY=YOUR_API_KEY

```

### Basic implementation

[](#basic-implementation)

Then, you can interact with Email Octopus's API like so:

```
$apiKey = getenv('EMAIL_OCTOPUS_API_KEY');

$client = EmailOctopus::client($apiKey);

$response = $client->lists()->createContact('00000000-0000-0000-0000-000000000000', [
    'email_address' => 'goran.popovic@geoligard.com', // required
    'fields' => [ // optional
        'FirstName' => 'Goran',
        'LastName' => 'Popović',
    ],
    'tags' => [ // optional
        'lead'
    ],
    'status' => 'SUBSCRIBED', // optional
]);

echo $response['status']; // SUBSCRIBED
```

If needed, there are additional options you can set when instantiating a `Client`:

```
$client = EmailOctopus::client(
    $apiKey,
    'https://emailoctopus.com/api/1.6/', // API base URI, for most cases default is fine and there is no need to set this variable
    30, // timeout - maximum number of seconds to wait for a response
    3 // connect timeout - maximum number of seconds to wait while trying to connect to a server
);
```

Usage
-----

[](#usage)

This wrapper tends to follow the logic and classification found in the official [Email Octopus API docs.](https://emailoctopus.com/api-documentation)All the routes, and available params for each route are explained in greater detail in those docs.

All the methods are assigned into 3 main resources:

- [Automation Resource](#automation-resource)
- [Campaign Resource](#campaign-resource)
- [List Resource](#list-resource)

### `Automation` Resource

[](#automation-resource)

You can find an ID of the automation you are currently viewing in the dashboard URL, like so: `https://emailoctopus.com/automations/`

#### start(string $automationId, array $params)

[](#startstring-automationid-array-params)

```
$client->automations()->start('00000000-0000-0000-0000-000000000000', [
    'list_member_id' => '00000000-0000-0000-0000-000000000000',
]);
```

### `Campaign` Resource

[](#campaign-resource)

You can find an ID of the campaign you are currently viewing in the dashboard URL, like so: `https://emailoctopus.com/reports/campaign/`

#### get(string $campaignId)

[](#getstring-campaignid)

```
$client->campaigns()->get('00000000-0000-0000-0000-000000000000');
```

#### getAll(array $params = \[\])

[](#getallarray-params--)

```
$client->campaigns()->getAll([
    'limit' => 1, // optional
    'page' => 2 // optional
]);
```

#### getReportSummary(string $campaignId)

[](#getreportsummarystring-campaignid)

```
$client->campaigns()->getReportSummary('00000000-0000-0000-0000-000000000000');
```

#### getReportLinks(string $campaignId)

[](#getreportlinksstring-campaignid)

```
$client->campaigns()->getReportLinks('00000000-0000-0000-0000-000000000000');
```

#### getReportBounced(string $campaignId, array $params)

[](#getreportbouncedstring-campaignid-array-params)

```
$client->campaigns()->getReportBounced('00000000-0000-0000-0000-000000000000', [
    'limit' => 1 // optional
]);
```

#### getReportClicked(string $campaignId, array $params)

[](#getreportclickedstring-campaignid-array-params)

```
$client->campaigns()->getReportClicked('00000000-0000-0000-0000-000000000000', [
    'limit' => 1 // optional
]);
```

#### getReportComplained(string $campaignId, array $params)

[](#getreportcomplainedstring-campaignid-array-params)

```
$client->campaigns()->getReportComplained('00000000-0000-0000-0000-000000000000', [
    'limit' => 1 // optional
]);
```

#### getReportOpened(string $campaignId, array $params)

[](#getreportopenedstring-campaignid-array-params)

```
$client->campaigns()->getReportOpened('00000000-0000-0000-0000-000000000000', [
    'limit' => 1 // optional
]);
```

#### getReportSent(string $campaignId, array $params)

[](#getreportsentstring-campaignid-array-params)

```
$client->campaigns()->getReportSent('00000000-0000-0000-0000-000000000000', [
    'limit' => 1 // optional
]);
```

#### getReportUnsubscribed(string $campaignId)

[](#getreportunsubscribedstring-campaignid)

```
$client->campaigns()->getReportUnsubscribed('00000000-0000-0000-0000-000000000000');
```

#### getReportNotClicked(string $campaignId, array $params)

[](#getreportnotclickedstring-campaignid-array-params)

```
$client->campaigns()->getReportNotClicked('00000000-0000-0000-0000-000000000000', [
    'limit' => 1 // optional
]);
```

#### getReportNotOpened(string $campaignId, array $params)

[](#getreportnotopenedstring-campaignid-array-params)

```
$client->campaigns()->getReportNotOpened('00000000-0000-0000-0000-000000000000', [
    'limit' => 1 // optional
]);
```

### `List` Resource

[](#list-resource)

To find the list ID, go to your Email Octopus dashboard, find the `Lists` tab, select a list by clicking on its title, and when you open a single list simply go to the `settings` tab and copy the ID from there. Alternatively, you can find an ID of the list or any other resource you are currently viewing in the dashboard URL, like so: `https://emailoctopus.com/lists/`

#### get(string $listId)

[](#getstring-listid)

```
$client->lists()->get('00000000-0000-0000-0000-000000000000');
```

#### getAll(array $params = \[\])

[](#getallarray-params---1)

```
$client->lists()->getAll([
    'limit' => 1, // optional
    'page' => 2 // optional
]);
```

#### create(array $params)

[](#createarray-params)

```
$client->lists()->create([
    'name' => 'Api test'
]);
```

#### update(string $listId, array $params)

[](#updatestring-listid-array-params)

```
$client->lists()->update('00000000-0000-0000-0000-000000000000', [
    'name' => 'New name'
]);
```

#### delete(string $listId)

[](#deletestring-listid)

```
$client->lists()->delete('00000000-0000-0000-0000-000000000000');
```

#### getAllTags(string $listId)

[](#getalltagsstring-listid)

```
$client->lists()->getAllTags('00000000-0000-0000-0000-000000000000');
```

#### getContact(string $listId, string $memberId)

[](#getcontactstring-listid-string-memberid)

```
$client->lists()->getContact(
    '00000000-0000-0000-0000-000000000000',
    '00000000-0000-0000-0000-000000000000',
);
```

#### getAllContacts(string $listId, array $params = \[\])

[](#getallcontactsstring-listid-array-params--)

```
$client->lists()->getAllContacts('00000000-0000-0000-0000-000000000000', [
    'limit' => 1, // optional
    'page' => 2 // optional
]);
```

#### getSubscribedContacts(string $listId, array $params = \[\])

[](#getsubscribedcontactsstring-listid-array-params--)

```
$client->lists()->getSubscribedContacts('00000000-0000-0000-0000-000000000000', [
    'limit' => 1, // optional
    'page' => 2 // optional
]);
```

#### getUnsubscribedContacts(string $listId, array $params = \[\])

[](#getunsubscribedcontactsstring-listid-array-params--)

```
$client->lists()->getUnsubscribedContacts('00000000-0000-0000-0000-000000000000', [
    'limit' => 1, // optional
    'page' => 2 // optional
]);
```

#### getContactsByTag(string $listId, string $listTag, array $params = \[\])

[](#getcontactsbytagstring-listid-string-listtag-array-params--)

```
$client->lists()->getContactsByTag('00000000-0000-0000-0000-000000000000', 'lead', [
    'limit' => 1
]);
```

#### createContact(string $listId, array $params)

[](#createcontactstring-listid-array-params)

```
$client->lists()->createContact('00000000-0000-0000-0000-000000000000', [
    'email_address' => 'goran.popovic@geoligard.com', // required
    'fields' => [ // optional
        'FirstName' => 'Goran',
        'LastName' => 'Popović',
    ],
    'tags' => [ // optional
        'lead'
    ],
    'status' => 'SUBSCRIBED', // optional
]);
```

#### updateContact(string $listId, string $memberId, array $params)

[](#updatecontactstring-listid-string-memberid-array-params)

Note: For member ID you can either use the ID of the list contact that you can find in the URL in the dashboard: `https://emailoctopus.com/lists//contacts/`, or an MD5 hash of the lowercase version of the list contact's email address.

```
$client->lists()->updateContact('00000000-0000-0000-0000-000000000000', md5('goran.popovic@geoligard.com'), [
    'email_address' => 'new_email_address@geoligard.com', // optional
    'fields' => [ // optional
        'FirstName' => 'New name',
        'LastName' => 'New lastname',
    ],
    'tags' => [ // optional
        'vip' => true,
        'lead' => false
    ],
    'status' => 'UNSUBSCRIBED', // optional
]);
```

#### deleteContact(string $listId, string $memberId)

[](#deletecontactstring-listid-string-memberid)

Note: For member ID you can either use the ID of the list contact that you can find in the URL in the dashboard: `https://emailoctopus.com/lists//contacts/`, or an MD5 hash of the lowercase version of the list contact's email address.

```
$client->lists()->deleteContact(
    '00000000-0000-0000-0000-000000000000',
    md5('goran.popovic@geoligard.com')
);
```

#### createField(string $listId, array $params)

[](#createfieldstring-listid-array-params)

```
$client->lists()->createField('00000000-0000-0000-0000-000000000000', [
    'label' => 'What is your hometown?',
    'tag' => 'Hometown',
    'type' => 'TEXT',
    'fallback' => 'Unknown' // optional
]);
```

#### updateField(string $listId, string $listFieldTag, array $params)

[](#updatefieldstring-listid-string-listfieldtag-array-params)

```
$client->lists()->updateField('00000000-0000-0000-0000-000000000000', 'Hometown', [
    'label' => 'New label',
    'tag' => 'NewTag',
    'fallback' => 'New fallback' // optional
]);
```

#### deleteField(string $listId, string $listFieldTag)

[](#deletefieldstring-listid-string-listfieldtag)

```
$client->lists()->deleteField('00000000-0000-0000-0000-000000000000', 'NewTag');
```

#### createTag(string $listId, array $params)

[](#createtagstring-listid-array-params)

```
$client->lists()->createTag('00000000-0000-0000-0000-000000000000', [
    'tag' => 'vip'
]);
```

#### updateTag(string $listId, string $listTag, array $params)

[](#updatetagstring-listid-string-listtag-array-params)

```
$client->lists()->updateTag('00000000-0000-0000-0000-000000000000', 'vip', [
    'tag' => 'New Tag Name'
]);
```

#### deleteTag(string $listId, string $listTag)

[](#deletetagstring-listid-string-listtag)

```
$client->lists()->deleteTag('00000000-0000-0000-0000-000000000000', 'New Tag Name');
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

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 ~59 days

Recently: every ~88 days

Total

7

Last Release

531d ago

Major Versions

v0.1.1 → v1.0.02024-01-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/00bba8beb84c18769d3ed29df4b9567ff71c553aa0dea93e87292067fd50c9f9?d=identicon)[geoligard](/maintainers/geoligard)

---

Top Contributors

[![goran-popovic](https://avatars.githubusercontent.com/u/10928632?v=4)](https://github.com/goran-popovic "goran-popovic (19 commits)")

---

Tags

apiclientemailoctopusnewsletterphpsdkphpsdkemailmarketingmailing listcampaignnewsletteremail octopus

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/goran-popovic-email-octopus-php/health.svg)

```
[![Health](https://phpackages.com/badges/goran-popovic-email-octopus-php/health.svg)](https://phpackages.com/packages/goran-popovic-email-octopus-php)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[mailerlite/mailerlite-api-v2-php-sdk

MailerLite API v2 PHP SDK

781.8M16](/packages/mailerlite-mailerlite-api-v2-php-sdk)[railsware/mailtrap-php

The Mailtrap SDK provides methods for all API functions.

60929.1k](/packages/railsware-mailtrap-php)[ecomailcz/ecomail

Ecomail.cz API Wrapper

17418.3k4](/packages/ecomailcz-ecomail)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[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)
