PHPackages                             netglue/psr-container-postmark - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. netglue/psr-container-postmark

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

netglue/psr-container-postmark
==============================

Postmark client factories for PSR Containers

1.12.0(1y ago)042.9k↑142.9%[1 issues](https://github.com/netglue/psr-container-postmark/issues)[6 PRs](https://github.com/netglue/psr-container-postmark/pulls)1MITPHPPHP ~8.2 || ~8.3 || ~8.4CI failing

Since Mar 18Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/netglue/psr-container-postmark)[ Packagist](https://packagist.org/packages/netglue/psr-container-postmark)[ RSS](/packages/netglue-psr-container-postmark/feed)WikiDiscussions 1.13.x Synced today

READMEChangelog (10)Dependencies (8)Versions (28)Used By (1)

PSR-11 Container Factories for Postmark API Clients
===================================================

[](#psr-11-container-factories-for-postmark-api-clients)

[![PHPUnit Test Suite](https://github.com/netglue/psr-container-postmark/workflows/Continuous%20Integration/badge.svg)](https://github.com/netglue/psr-container-postmark/workflows/Continuous%20Integration/badge.svg)[![Type Coverage](https://camo.githubusercontent.com/b3c9dcbe0d8c51aa70f7b9310f9cfadb9e5f1e3e69495e46af33da048e1ff16a/68747470733a2f2f73686570686572642e6465762f6769746875622f6e6574676c75652f7073722d636f6e7461696e65722d706f73746d61726b2f636f7665726167652e737667)](https://shepherd.dev/github/netglue/psr-container-postmark)

Introduction
------------

[](#introduction)

This very small library provides [PSR-11](https://www.php-fig.org/psr/psr-11/) compatible factories for creating Postmark HTTP clients for either servers for sending mail, or the admin client for managing your account.

[Postmark](https://postmarkapp.com) is a reliable transactional email delivery service. These factories return clients from their [official PHP library](https://github.com/wildbit/postmark-php).

Install
-------

[](#install)

```
composer require netglue/psr-container-postmark
```

Usage
-----

[](#usage)

By default, the container will look for application configuration using the id `config` which is a generally accepted standard. If your PSR-11 container doesn't return an associative array when calling `$container->get('config')` then this lib will likely be useless to you.

Postmark-specific configuration is, by default, expected underneath the `'postmark'` key, though this *can* be modified.

Assuming defaults, your configuration for the clients should look like this:

```
return [
    'postmark' => [
        'server_token' => 'Your Server Token',
        'server_timeout' => 30, // The default is 30, as per Postmark's libs so this option can be omitted
        'admin_token' => 'Your Account Token', // Only required if you are using the Admin client to manage an account
    ],
];
```

You would then wire up your container so that a key of your choosing is mapped to the factory classes, perhaps:

```
return [
    'dependencies' => [
        'factories' => [
            Postmark\PostmarkClient::class => Netglue\PsrContainer\Postmark\ClientFactory::class,
            Postmark\PostmarkAdminClient::class => Netglue\PsrContainer\Postmark\AdminClientFactory::class,
        ],
    ],
];
```

If you run multiple servers for some reason, you can wire up the factory in the following way to use different configuration for different servers:

```
return [
    'dependencies' => [
        'factories' => [
            'EmailServer1' => [Netglue\PsrContainer\Postmark\ClientFactory::class, 'postmark_server_1'],
            'EmailServer2' => [Netglue\PsrContainer\Postmark\ClientFactory::class, 'postmark_server_2'],
        ],
    ],
];
```

Given the above container setup, you'd need to specify two top-level configuration arrays with a server key in each for `'postmark_server_1'` and `'postmark_server_2'`

Laminas Integration
-------------------

[](#laminas-integration)

Because I use Laminas *(Formerly Zend)* components a lot, this lib will auto-wire dependencies *(if you choose to allow it)* during composer installation thanks to [laminas-component-installer](https://docs.laminas.dev/laminas-component-installer/).

*fin.*

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance68

Regular maintenance activity

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 63.5% 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 ~85 days

Recently: every ~102 days

Total

22

Last Release

504d ago

PHP version history (9 changes)1.0.0PHP &gt;=7.3

1.3.0PHP ^7.3||^8.0

1.3.1PHP ^7.3||~8.0

1.4.0PHP ^7.3||~8.0||~8.1

1.6.0PHP ^7.4||~8.0||~8.1

1.8.0PHP ~8.0 || ~8.1 || ~8.2

1.10.0PHP ~8.1 || ~8.2

1.11.x-devPHP ~8.1 || ~8.2 || ~8.3

1.12.0PHP ~8.2 || ~8.3 || ~8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6c21b0de8cc9938916a186f5f2ed0bee90a4e23e0b29cf7b9c18bfe99067f9b?d=identicon)[netglue](/maintainers/netglue)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (332 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (71 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (60 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (60 commits)")

---

Tags

laminaspostmarkpostmark-integrationspsr-11

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/netglue-psr-container-postmark/health.svg)

```
[![Health](https://phpackages.com/badges/netglue-psr-container-postmark/health.svg)](https://phpackages.com/packages/netglue-psr-container-postmark)
```

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k455.6M9.6k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

706130.3M13.3k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31182.0M2.4k](/packages/illuminate-container)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[symfony/type-info

Extracts PHP types information.

20069.8M270](/packages/symfony-type-info)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)

PHPackages © 2026

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