Download the PHP package goran-popovic/email-octopus-php without Composer
On this page you can find all versions of the php package goran-popovic/email-octopus-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download goran-popovic/email-octopus-php
More information about goran-popovic/email-octopus-php
Files in goran-popovic/email-octopus-php
Package email-octopus-php
Short Description Email Octopus SDK for PHP
License MIT
Homepage https://github.com/goran-popovic/email-octopus-php
Informations about the package email-octopus-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
- >= 7.2.5
Installation
You can install the package via composer:
Getting Started
API key
Before being able to use the SDK, you would need to create an Email Octopus API key.
.env settings
After creating the key, you could edit any .env
file
you might be using and add your API key there, for example:
Basic implementation
Then, you can interact with Email Octopus's API like so:
If needed, there are additional options you can set when instantiating a Client
:
Usage
This wrapper tends to follow the logic and classification found in the official Email Octopus API docs. 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
- Campaign Resource
- List 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/<automationId>
start(string $automationId, array $params)
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/<campaignId>
get(string $campaignId)
getAll(array $params = [])
getReportSummary(string $campaignId)
getReportLinks(string $campaignId)
getReportBounced(string $campaignId, array $params)
getReportClicked(string $campaignId, array $params)
getReportComplained(string $campaignId, array $params)
getReportOpened(string $campaignId, array $params)
getReportSent(string $campaignId, array $params)
getReportUnsubscribed(string $campaignId)
getReportNotClicked(string $campaignId, array $params)
getReportNotOpened(string $campaignId, array $params)
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/<listId>
get(string $listId)
getAll(array $params = [])
create(array $params)
update(string $listId, array $params)
delete(string $listId)
getAllTags(string $listId)
getContact(string $listId, string $memberId)
getAllContacts(string $listId, array $params = [])
getSubscribedContacts(string $listId, array $params = [])
getUnsubscribedContacts(string $listId, array $params = [])
getContactsByTag(string $listId, string $listTag, array $params = [])
createContact(string $listId, array $params)
updateContact(string $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/<listId>/contacts/<contactId>
,
or an MD5 hash of the lowercase version of the list contact's email address.
deleteContact(string $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/<listId>/contacts/<contactId>
,
or an MD5 hash of the lowercase version of the list contact's email address.
createField(string $listId, array $params)
updateField(string $listId, string $listFieldTag, array $params)
deleteField(string $listId, string $listFieldTag)
createTag(string $listId, array $params)
updateTag(string $listId, string $listTag, array $params)
deleteTag(string $listId, string $listTag)
Changelog
Please see CHANGELOG for more information on what has changed recently.