PHPackages                             angegroup/notifier - 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. angegroup/notifier

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

angegroup/notifier
==================

Notifier is an API developed by AngeGroup. Queue messages for offline PocketMine players and deliver them on next join.

2.0.0(1mo ago)08MITPHPPHP &gt;=8.2CI passing

Since Nov 3Pushed 1mo agoCompare

[ Source](https://github.com/AngeGroup/Notifier)[ Packagist](https://packagist.org/packages/angegroup/notifier)[ RSS](/packages/angegroup-notifier/feed)WikiDiscussions stable Synced today

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Notifier
========

[](#notifier)

[![CI](https://github.com/AngeGroup/Notifier/actions/workflows/ci.yml/badge.svg)](https://github.com/AngeGroup/Notifier/actions/workflows/ci.yml)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

PocketMine-MP library for queuing chat messages, titles, popups and tips to offline players and delivering them on next join. Messages are persisted to disk so they survive restarts, support TTL expiration, and never get dropped on race with new writes.

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

[](#installation)

```
composer require angegroup/notifier
```

Requires PHP 8.2+ and PocketMine-MP.

Usage
-----

[](#usage)

### Queue a message

[](#queue-a-message)

```
use notifier\MessageType;
use notifier\Notifier;

$notifier = new Notifier();

// Plain chat message, by UUID (preferred — survives name changes)
$notifier->queue($uuid, "§aYour reward is waiting at /claim.");

// By player name (fallback when only the name is known)
$notifier->queueByName("steve", "§eYou were promoted to moderator.");

// Different display channels — title, popup, or tip
$notifier->queue($uuid, "§6Welcome back!", MessageType::Title);
$notifier->queueByName("steve", "§bDaily bonus available", MessageType::Popup);

// With expiration: drop the message if not delivered within an hour
$notifier->queue($uuid, "Flash event in progress!", MessageType::Chat, ttlSeconds: 3600);

// Bulk queue — same message to many recipients (auto-detects UUID vs name)
$notifier->queueMany([$uuid1, $uuid2, "steve"], "§dServer restart in 5 min");
```

Writes are append-only and lock-protected, so concurrent producers won't clobber each other.

### Deliver on join

[](#deliver-on-join)

Wire `deliverQueued()` from a `PlayerJoinEvent` listener:

```
use notifier\Notifier;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerJoinEvent;

final class JoinListener implements Listener {
    public function __construct(private Notifier $notifier) {}

    public function onJoin(PlayerJoinEvent $event): void {
        $this->notifier->deliverQueued($event->getPlayer());
    }
}
```

Delivery is atomic: the queue file is renamed before being read, so any messages queued during delivery land in a fresh file rather than being silently dropped. Expired messages are skipped.

### Inspect, count, or clear the queue

[](#inspect-count-or-clear-the-queue)

```
// All queued notifications, grouped by file → list of QueuedMessage
$all = $notifier->listQueued();

// Just one player (UUID or name)
$mine = $notifier->listQueued("steve");
foreach ($mine as $file => $messages) {
    foreach ($messages as $msg) {
        echo $msg->message, ' (', $msg->type->value, ")\n";
    }
}

// Fast count without loading message bodies
$pending = $notifier->count();
$forSteve = $notifier->count("steve");

// Drop everything
$notifier->clearQueued();

// Drop one player's queue
$notifier->clearQueued($uuid);
```

### Hook delivery via the event

[](#hook-delivery-via-the-event)

`DeliverQueuedEvent` fires once per non-expired message. Cancel it to drop a message or mutate it to rewrite the payload:

```
use notifier\MessageType;
use notifier\event\DeliverQueuedEvent;
use pocketmine\event\Listener;

final class NotificationFilter implements Listener {
    public function onDeliver(DeliverQueuedEvent $event): void {
        if ($event->getPlayer()->isCreative()) {
            $event->cancel();
            return;
        }
        $event->setMessage("[Mail] " . $event->getMessage());
        $event->setType(MessageType::Popup); // re-route from chat to popup
    }
}
```

Storage format
--------------

[](#storage-format)

Each message is one JSON object per line:

```
{"m":"Hello!","t":"chat","e":1715900000}
```

Legacy plain-text lines are still read and treated as chat with no expiration — the format upgrade is fully backwards compatible.

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

[](#configuration)

The constructor accepts a custom storage directory. The default (`/var/notifications`) works for most setups:

```
$notifier = new Notifier("/custom/path");
```

Development
-----------

[](#development)

```
composer install --ignore-platform-reqs   # PMMP needs native exts we don't run
composer test            # PHPUnit (unit tests)
composer test-coverage   # PHPUnit with coverage summary
composer cs-check        # php-cs-fixer dry-run
composer cs-fix          # apply formatting
composer phpstan         # static analysis
```

### Test layout

[](#test-layout)

```
tests/
├── MessageTypeTest.php         # enum cases & tryFrom
├── QueuedMessageTest.php       # value object & isExpired
├── NotifierTest.php            # queue / list / count / clear / TTL / format
└── event/
    └── DeliverQueuedEventTest.php   # event accessors & cancel

```

`Notifier::deliverQueued()` is exercised indirectly: its decoding, expiration filter, and dispatch routing logic are covered through the public API and `QueuedMessage::isExpired()`. The PocketMine event call itself requires a booted server and is intentionally not unit-tested.

CI runs `composer validate`, a syntax check, php-cs-fixer (dry-run), PHPStan level 8, and PHPUnit on every push and pull request.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~192 days

Total

2

Last Release

49d ago

Major Versions

v1.0.0 → 2.0.02026-05-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/61889427?v=4)[Dumont-Julien](/maintainers/Dumont-Julien)[@Dumont-Julien](https://github.com/Dumont-Julien)

---

Top Contributors

[![Dumont-Julien](https://avatars.githubusercontent.com/u/61889427?v=4)](https://github.com/Dumont-Julien "Dumont-Julien (6 commits)")

---

Tags

notificationqueuebedrockminecraftpocketminepocketmine-mp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/angegroup-notifier/health.svg)

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

###  Alternatives

[symfony/notifier

Sends notifications via one or more channels (email, SMS, ...)

80643.9M438](/packages/symfony-notifier)[jolicode/jolinotif

Send desktop notifications on Windows, Linux, MacOS.

1.4k12.7M68](/packages/jolicode-jolinotif)[duccio/apns-php

Apple Push Notification &amp; Feedback Provider

1.4k2.6M13](/packages/duccio-apns-php)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.8M47](/packages/laravel-notification-channels-telegram)[mckenziearts/laravel-notify

Flexible flash notifications for Laravel

1.7k1.1M5](/packages/mckenziearts-laravel-notify)[spatie/laravel-failed-job-monitor

Get notified when a queued job fails

1.1k2.8M4](/packages/spatie-laravel-failed-job-monitor)

PHPackages © 2026

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