PHPackages                             sendigram/ems-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. [API Development](/categories/api)
4. /
5. sendigram/ems-php

ActiveLibrary[API Development](/categories/api)

sendigram/ems-php
=================

Official Sendigram EMS OpenAPI PHP SDK.

v1.0.0(3w ago)00MITPHPPHP ^8.1CI passing

Since Jul 3Pushed 3w agoCompare

[ Source](https://github.com/admin-sendigram/sendigram-php-sdk)[ Packagist](https://packagist.org/packages/sendigram/ems-php)[ RSS](/packages/sendigram-ems-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (8)Versions (2)Used By (0)

Sendigram EMS PHP SDK
=====================

[](#sendigram-ems-php-sdk)

Official PHP SDK for the [Sendigram EMS](https://ems.sendigram.com) OpenAPI.

Requirements
------------

[](#requirements)

- PHP 8.1+
- ext-json
- A PSR-18 HTTP client (Guzzle 7 is installed by default)

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

[](#installation)

```
composer require sendigram/ems-php
```

Quickstart
----------

[](#quickstart)

```
use Sendigram\Ems\Client\EmsClient;

$client = new EmsClient('YOUR_API_TOKEN');

// List the first page of contacts
$list = $client->contacts->list(perPage: 50);
foreach ($list->data as $contact) {
    echo $contact->email, "\n";
}

// Fetch one
$contact = $client->contacts->get(42);

// Create
$created = $client->contacts->create(
    email:     'john@example.com',
    firstName: 'John',
    lastName:  'Doe',
);

// Update (only provided fields are touched)
$updated = $client->contacts->update(42, firstName: 'Jane');

// Upsert by email
$result = $client->contacts->upsert(email: 'alice@example.com', firstName: 'Alice');
$result->created;          // true on HTTP 201, false on HTTP 200
$result->contact;          // typed Contact

// Delete
$client->contacts->delete(42);
$client->contacts->deleteByEmail('john@example.com');

// Iterate every page lazily
foreach ($client->contacts->iterate(perPage: 100) as $contact) {
    // …
}
```

Authentication
--------------

[](#authentication)

Issue a token from the EMS dashboard under **Account → API token** and pass it to `EmsClient`. The SDK sends `Authorization: Bearer {token}` on every request.

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

[](#configuration)

```
use Sendigram\Ems\Client\Configuration;
use Sendigram\Ems\Client\EmsClient;

$client = new EmsClient(
    Configuration::default('YOUR_API_TOKEN')
        ->withBaseUrl('https://ems.sendigram.com/open-api/v1/')
        ->withTimeout(60)
        ->withUserAgent('my-app/1.0'),
);
```

Custom HTTP client
------------------

[](#custom-http-client)

Any PSR-18 client works. Pass your own to bypass Guzzle:

```
$client = new EmsClient(
    config:         Configuration::default('YOUR_API_TOKEN'),
    httpClient:     $mySymfonyHttpClient,
    requestFactory: $myRequestFactory,
    streamFactory:  $myStreamFactory,
);
```

Error handling
--------------

[](#error-handling)

Every SDK error extends `Sendigram\Ems\Client\Exception\EmsException`. HTTP errors are typed:

```
use Sendigram\Ems\Client\Exception\NotFoundException;
use Sendigram\Ems\Client\Exception\RateLimitException;
use Sendigram\Ems\Client\Exception\ValidationException;

try {
    $client->contacts->create(email: 'not-an-email');
} catch (ValidationException $e) {
    foreach ($e->errors() as $field => $messages) {
        echo "{$field}: " . implode('; ', $messages), "\n";
    }
} catch (NotFoundException $e) {
    // 404
} catch (RateLimitException $e) {
    sleep($e->retryAfter() ?? 60);
}
```

StatusException400`BadRequestException`401`UnauthorizedException`403`ForbiddenException`404`NotFoundException`422`ValidationException` (has `errors()`)429`RateLimitException` (has `retryAfter()`)5xx`ServerException`transport failure`NetworkException`body parse failure`SerializationException`Examples
--------

[](#examples)

See [`examples/`](examples) for runnable scripts.

Versioning
----------

[](#versioning)

This package follows [SemVer](https://semver.org). Currently targets EMS API `v1`.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance95

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

22d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb608a0f0ef786c5f2fd6d6a7b69555d194c2a1b070ec48a7ea02ff77ac06d74?d=identicon)[admin@sendigram.com](/maintainers/admin@sendigram.com)

---

Tags

sdkopenapiemail marketingcontactsEMSSendigram

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sendigram-ems-php/health.svg)

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36789.4k2](/packages/telnyx-telnyx-php)[aws/aws-sdk-php

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

6.2k543.5M2.7k](/packages/aws-aws-sdk-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M754](/packages/sylius-sylius)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M50](/packages/getbrevo-brevo-php)

PHPackages © 2026

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