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

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

goran-popovic/email-octopus-laravel
===================================

Email Octopus SDK for Laravel

v1.0.1(2y ago)102551[1 PRs](https://github.com/goran-popovic/email-octopus-laravel/pulls)MITPHPPHP ^7.2.5|^8.0

Since Jan 28Pushed 2y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

Email Octopus SDK for Laravel
=============================

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

Email Octopus SDK for Laravel 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.

Note

This repository contains the code that is most suited to be used with Laravel framework. If you want to use the PHP API client in a framework-agnostic way, check out the `goran-popovic/email-octopus-php` repository.

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

[](#php-version-support)

- &gt;= 7.2.5

Laravel Version Support
-----------------------

[](#laravel-version-support)

- &gt;= 7.29.0

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

[](#installation)

You can install the package via composer:

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

If you wish to publish the config file to `config/email-octopus.php` run:

```
php artisan vendor:publish --tag="email-octopus-config"
```

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 by following the instructions above, edit your `.env` file and add the API key there:

```
EMAIL_OCTOPUS_API_KEY=YOUR_API_KEY

```

### Facade

[](#facade)

Package will register a Facade that you can use in your app to make API calls, just make sure to include it at the top of the file:

```
use GoranPopovic\EmailOctopus\Facades\EmailOctopus;
```

### Basic implementation

[](#basic-implementation)

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

```
use GoranPopovic\EmailOctopus\Facades\EmailOctopus;

$response = EmailOctopus::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
```

Configuration
-------------

[](#configuration)

Other available config settings include the ability to set the base URI of the API, timeout and connect timeout. For most use cases the defaults are just fine, but if you want, you can set those params in either the config file (`config/email-octopus`) or by using environment variables.

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)

```
EmailOctopus::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)

```
EmailOctopus::campaigns()->get('00000000-0000-0000-0000-000000000000');
```

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

[](#getallarray-params--)

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

#### getReportSummary(string $campaignId)

[](#getreportsummarystring-campaignid)

```
EmailOctopus::campaigns()->getReportSummary('00000000-0000-0000-0000-000000000000');
```

#### getReportLinks(string $campaignId)

[](#getreportlinksstring-campaignid)

```
EmailOctopus::campaigns()->getReportLinks('00000000-0000-0000-0000-000000000000');
```

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#### getReportUnsubscribed(string $campaignId)

[](#getreportunsubscribedstring-campaignid)

```
EmailOctopus::campaigns()->getReportUnsubscribed('00000000-0000-0000-0000-000000000000');
```

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

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

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

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

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

```
EmailOctopus::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)

```
EmailOctopus::lists()->get('00000000-0000-0000-0000-000000000000');
```

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

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

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

#### create(array $params)

[](#createarray-params)

```
EmailOctopus::lists()->create([
    'name' => 'Api test'
]);
```

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

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

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

#### delete(string $listId)

[](#deletestring-listid)

```
EmailOctopus::lists()->delete('00000000-0000-0000-0000-000000000000');
```

#### getAllTags(string $listId)

[](#getalltagsstring-listid)

```
EmailOctopus::lists()->getAllTags('00000000-0000-0000-0000-000000000000');
```

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

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

```
EmailOctopus::lists()->getContact(
    '00000000-0000-0000-0000-000000000000',
    '00000000-0000-0000-0000-000000000000',
);
```

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

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

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

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

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

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

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

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

```
EmailOctopus::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--)

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

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

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

```
EmailOctopus::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.

```
EmailOctopus::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.

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

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

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

```
EmailOctopus::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)

```
EmailOctopus::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)

```
EmailOctopus::lists()->deleteField('00000000-0000-0000-0000-000000000000', 'NewTag');
```

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

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

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

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

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

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

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

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

```
EmailOctopus::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

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

779d ago

Major Versions

v0.1.0 → v1.0.02024-02-01

### 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 (5 commits)")

---

Tags

apiclientemailoctopuslaravelnewsletterphpsdkphplaravelsdkemailmarketingmailing listcampaignnewsletteremail octopus

### Embed Badge

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

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

###  Alternatives

[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[railsware/mailtrap-php

The Mailtrap SDK provides methods for all API functions.

56770.5k](/packages/railsware-mailtrap-php)[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. 🚀

14109.2k](/packages/hafael-azure-mailer-driver)[princealikhan/laravel-mautic-api

Free and Open Source Marketing Automation API

415.9k](/packages/princealikhan-laravel-mautic-api)[martian/spammailchecker

A laravel package that protect users from entering non-existing/spam email addresses.

422.0k](/packages/martian-spammailchecker)

PHPackages © 2026

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