emailon-api / php-client
Email Marketing Software library for PHP
Requires
- php: >=8.2
- ext-curl: *
- ext-json: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.92
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
- rector/rector: ^2.1
Suggests
- ext-apcu: Required to use the EmailonApi\Cache\Apc cache adapter.
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-09-09 06:32:46 UTC
README
This is the PHP Client for eMailON's API.
Install
Option A — Via Packagist (recommended)
This package is published on Packagist
as emailon-api/php-client. Get started by installing it via composer as follows:
composer require emailon-api/php-client
Composer will download the package and generate the autoloader for you, so
EmailonApi\... classes are available right away.
Option B — Local usage (without Packagist)
If you'd rather not depend on Packagist — e.g. for an internal fork, or before the package is published/updated there — you can pull this repository directly into your own project instead. Pick one of the two sub-options below.
B1 — Composer "path" repository
Clone/download this repository somewhere in your project, e.g. into
libs/emailon-php-client, then in your own project's composer.json add:
{
"repositories": [
{
"type": "path",
"url": "libs/emailon-php-client"
}
],
"require": {
"emailon-api/php-client": "*"
}
}
Then run:
composer update
Composer will symlink the local folder in and generate the autoloader for you,
so EmailonApi\... classes are available exactly like a normal package.
B2 — Manual include (no Composer at all)
If you don't want to touch Composer, download/clone this repository and
require a tiny autoloader in your bootstrap file:
<?php spl_autoload_register(function (string $class): void { $prefix = 'EmailonApi\\'; if (strncmp($prefix, $class, strlen($prefix)) !== 0) { return; } $relative = substr($class, strlen($prefix)); $file = '/absolute/path/to/emailon-php-client/src/' . str_replace('\\', '/', $relative) . '.php'; if (is_file($file)) { require $file; } });
Either way, then follow the instructions from example/setup.php file.
Requirements
- PHP 8.2 or newer
ext-curlext-json
If you want to use the in-memory cache adapter, install ext-apcu. The legacy XCache adapter is no longer supported.
Test
Following environment variables have to be set, with their proper values:
EMAILON_API_URL
EMAILON_API_KEY
Then you can run the tests:
$ composer test
The API-backed endpoint tests are kept separately because they require a real MailWizz API URL and key:
$ composer test-integration
Development
The 2.x branch targets PHP 8.2+ and includes the following maintenance commands:
$ composer analyse $ composer refactor-dry-run $ composer refactor