milpa/notifications

Channel-agnostic notification dispatch for the Milpa PHP framework: register channels (Telegram, Pushover, WebSocket, ...) and fan a payload out to recipients by "channel:recipient".

Maintainers

Package info

github.com/getmilpa/notifications

pkg:composer/milpa/notifications

Transparency log

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-07-29 17:13 UTC

This package is auto-updated.

Last update: 2026-07-29 17:17:05 UTC


README

Milpa

Milpa Notifications

Channel-agnostic notification dispatch for the Milpa PHP framework — one payload, many channels, and a failing channel never takes the others down.

CI Packagist PHP License

Register channels (Telegram, Pushover, WebSocket, e-mail, …) and fan a single payload out to recipients addressed as channel:recipient — or broadcast one payload to every channel. The package owns the contracts and a default payload value object; the channels come from the host or its plugins.

Register notification channels (Telegram, Pushover, WebSocket, e-mail, …) and fan a single payload out to recipients addressed as channel:recipient — or broadcast one payload to every channel. The package owns the contracts (NotificationChannelInterface, NotificationPayloadInterface) and a default payload value object; channels are supplied by the host or its plugins.

  • Zero framework coupling — the only runtime dependency is PSR-3 (psr/log) for optional logging. No ORM, no HTTP, no container.
  • Fail-soft — a throwing or missing channel never aborts the dispatch; each recipient gets its own boolean result and the error is logged.

Install

composer require milpa/notifications

Usage

use Milpa\Notifications\NotificationDispatcher;
use Milpa\Notifications\NotificationPayload;

$dispatcher = (new NotificationDispatcher($logger))
    ->addChannel($telegramChannel); // implements Milpa\Notifications\Contracts\NotificationChannelInterface

$payload = new NotificationPayload(type: 'alert', title: 'Deploy finished');

// Targeted: "channel:recipient" — routed to the matching channel.
$dispatcher->dispatch($payload, ['telegram:123456']);

// Broadcast: the same recipient id across every registered channel.
$dispatcher->broadcast($payload, '123456');

Contributing

See CONTRIBUTING.md. Security reports go through SECURITY.md — privately, via GitHub Security Advisories.

License

Apache-2.0 © Rodrigo Vicente - TeamX Agency.

Milpa is designed, built, and maintained by Rodrigo Vicente - TeamX Agency.