PHPackages                             waaseyaa/notification - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. waaseyaa/notification

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

waaseyaa/notification
=====================

Multi-channel notification system for Waaseyaa

v0.1.0-alpha.259(2w ago)01.8k↑295.2%2GPL-2.0-or-laterPHPPHP &gt;=8.5

Since Apr 8Pushed 1w agoCompare

[ Source](https://github.com/waaseyaa/notification)[ Packagist](https://packagist.org/packages/waaseyaa/notification)[ RSS](/packages/waaseyaa-notification/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (35)Versions (146)Used By (2)

waaseyaa/notification
=====================

[](#waaseyaanotification)

**Layer 3 — Services**

Multi-channel notification system for Waaseyaa. A `NotificationInterface` declares which channels it targets (`via()`) and how it renders for each (`toMail()`, `toDatabase()`, …); a `NotifiableInterface` recipient supplies its per-channel routing (email address, database id). `NotificationDispatcher` fans a notification out across the matching `ChannelInterface` implementations — synchronously, or queued via the framework `Job` system so user-facing requests never wait on email or persistence. Channel delivery is best-effort: a single channel throwing is logged, not propagated.

Install
-------

[](#install)

Ships as part of `waaseyaa/framework` — consumers on the `core`/`cms`/`full` metapackages already have it. To pull it on its own:

```
composer require waaseyaa/notification
```

The package self-registers `NotificationServiceProvider` (via `extra.waaseyaa.providers`), which binds `NotificationDispatcher` as a singleton and assembles the `mail` and `database` channels from whatever `MailerInterface` / `DatabaseInterface` are configured.

Key API
-------

[](#key-api)

```
interface NotificationInterface
{
    /** @return list channel names, e.g. ['mail', 'database'] */
    public function via(NotifiableInterface $notifiable): array;
    /** @return array */
    public function toArray(NotifiableInterface $notifiable): array;
    // Optional, resolved by channels via method_exists():
    //   toMail(NotifiableInterface): \Waaseyaa\Mail\Envelope
    //   toDatabase(NotifiableInterface): array
}

interface NotifiableInterface          // @api
{
    public function routeNotificationFor(string $channel): mixed; // 'mail' => email, 'database' => id
    public function getNotifiableId(): string;
    public function getNotifiableType(): string;
}

interface ChannelInterface
{
    public function send(NotifiableInterface $notifiable, NotificationInterface $notification): void;
}

final class NotificationDispatcher     // @api
{
    /** @param array $channels */
    public function __construct(QueueInterface $queue, array $channels, ?LoggerInterface $logger = null);
    public function send(NotifiableInterface $notifiable, NotificationInterface $notification): void;       // sync
    public function sendAsync(NotifiableInterface $notifiable, NotificationInterface $notification): void;  // queued
    /** @param iterable $notifiables */
    public function sendToMany(iterable $notifiables, NotificationInterface $notification): void;
    /** @return array */
    public function channels(): array;
}
```

Helpers: `NotifiableTrait` (`@api`) implements `NotifiableInterface` for any class exposing `get()`/`id()`/`getEntityTypeId()` (e.g. `EntityBase` subclasses); `DefaultNotifiable` is a standalone implementation for apps and tests. Built-in channels: `Channel\MailChannel`, `Channel\DatabaseChannel` (persists to `waaseyaa_notifications`). Async delivery uses `Job\SendNotificationJob`.

Usage
-----

[](#usage)

```
use Waaseyaa\Notification\{NotifiableInterface, NotificationInterface, NotificationDispatcher};
use Waaseyaa\Notification\Channel\MailChannel;
use Waaseyaa\Mail\{Envelope, Mailer};
use Waaseyaa\Queue\SyncQueue;

$notification = new class implements NotificationInterface {
    public function via(NotifiableInterface $n): array { return ['mail']; }
    public function toArray(NotifiableInterface $n): array { return ['message' => 'Welcome']; }
    public function toMail(NotifiableInterface $n): Envelope {
        return new Envelope(
            to: [$n->routeNotificationFor('mail')],
            from: 'noreply@example.com',
            subject: 'Welcome',
            textBody: 'Thanks for joining.',
        );
    }
};

$dispatcher = new NotificationDispatcher(
    new SyncQueue(),
    ['mail' => new MailChannel($mailer)],
);

$dispatcher->send($user, $notification);   // $user implements NotifiableInterface
```

Resolve `NotificationDispatcher` from the container instead of constructing it by hand once the service provider is booted; call `sendAsync()` to queue delivery for the worker.

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance97

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80.2% 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 ~1 days

Total

145

Last Release

14d ago

PHP version history (2 changes)v0.1.0-alpha.114PHP &gt;=8.4

v0.1.0-alpha.176PHP &gt;=8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/25d0ff572e93e3461e5180a920725d65691fd1e15e2d914b254dbbc2d6c393bd?d=identicon)[jonesrussell](/maintainers/jonesrussell)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (85 commits)")[![jonesrussell](https://avatars.githubusercontent.com/u/499552?v=4)](https://github.com/jonesrussell "jonesrussell (21 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/waaseyaa-notification/health.svg)

```
[![Health](https://phpackages.com/badges/waaseyaa-notification/health.svg)](https://phpackages.com/packages/waaseyaa-notification)
```

PHPackages © 2026

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