PHPackages                             fucodo/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. fucodo/notification

ActiveNeos-package[Mail &amp; Notifications](/categories/mail)

fucodo/notification
===================

0394↓33.3%PHP

Since Nov 12Pushed 6mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

fucodo/notification
===================

[](#fucodonotification)

Lightweight notifications package for Neos Flow applications. It provides:

- A `Notification` domain model persisted via Doctrine DBAL
- A `NotificationRepository` with convenience methods (find by user, delete by id(s), cleanup old)
- A `NotificationService` to send notifications to one or many users
- A CLI command to send notifications from the terminal
- A small Web Component to render notifications in the backend/top bar

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

[](#requirements)

- Neos Flow (see `composer.json`, version managed by your distribution)
- A database configured for Flow/Doctrine

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

[](#installation)

```
composer require fucodo/notification

```

Then update the database schema:

```
./flow doctrine:migrate
# or, if you prefer schema generation
./flow doctrine:update

```

The table name used is `fucodo_notification_domain_model_notification`.

Usage
-----

[](#usage)

### Send notifications from PHP

[](#send-notifications-from-php)

Use the `NotificationService` to create notifications for one or multiple users. Parameters like `subjectParameters`, `messageParameters`, and `actions` are stored as JSON.

```
use fucodo\Notification\Service\NotificationService;

class SomeService
{
    public function __construct(private NotificationService $notificationService) {}

    public function doSomething(): void
    {
        $this->notificationService->sendToUsers(
            users: ['jane.doe', 'john.doe'],
            app: 'fucodo.notification',
            subject: 'New report is ready',
            message: 'Click to view the latest monthly report.',
            objectType: 'report',
            objectId: 'report-2025-11',
            link: '/backend/reports/2025-11',
            icon: 'icon-report',
            subjectParameters: ['month' => 'Nov 2025'],
            messageParameters: ['severity' => 'info'],
            actions: [
                ['label' => 'Open', 'href' => '/backend/reports/2025-11'],
            ],
        );
    }
}
```

### Send notifications via CLI

[](#send-notifications-via-cli)

```
./flow notification:sendmessage \
  --app "fucodo.notification" \
  --subject "Info" \
  --message "Hello from CLI" \
  --users "user1,user2" \
  --object-type "cli" \
  --object-id "optional-id" \
  --link "/some/target" \
  --icon "icon-name"

```

- `--users` is a comma-separated list and empties/spaces are ignored.
- The command reports how many users were notified.

### Reading and managing notifications

[](#reading-and-managing-notifications)

Use `NotificationRepository` in your code to fetch or delete entries:

```
use fucodo\Notification\Domain\Repository\NotificationRepository;

// find last 20 notifications for a user
$result = $notificationRepository->findByUserIdentifier('jane.doe', 20, 0);

// delete a single notification for a user (mark as read)
$deleted = $notificationRepository->deleteByIdForUser(123, 'jane.doe');

// delete many for a user
$deletedTotal = $notificationRepository->deleteByIdsForUser([123,124,125], 'jane.doe');

// housekeeping: delete older than timestamp
$removed = $notificationRepository->deleteOlderThan(strtotime('-90 days'));
```

### Rendering in the UI (Web Component)

[](#rendering-in-the-ui-web-component)

A minimal Web Component is bundled in `Resources/Public/WebComponents/fucodo-notifications/` and is used by the backend top bar include in `Resources/Private/Backend/TopBar/Notification.html`.

Basic usage example in HTML:

```

```

The component expects a JSON list with objects similar to what `Notification::jsonSerialize()` produces.

Data model
----------

[](#data-model)

Main fields stored for each notification:

- `id` (auto-increment)
- `user` (string)
- `app` (string)
- `timestamp` (int, Unix time)
- `objectType`/`objectId` (strings)
- `subject`/`message` (strings)
- `subjectParameters`/`messageParameters` (JSON text, nullable)
- `link`/`icon` (nullable strings)
- `actions` (JSON text, nullable)

Note: inserts are performed via `NotificationRepository::add()` using DBAL and the entity is updated with the inserted `id`. A Flow signal `notificationAdded` is emitted and can be connected via AOP.

Configuration notes
-------------------

[](#configuration-notes)

- Package key: `fucodo.notification`
- PHP namespace: `fucodo\\Notification`
- Autoload: PSR-4 from `Classes/`

No special settings are required. You can add controllers/endpoints to expose notification lists as needed by your project.

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

[](#development)

- Code style and patterns follow Neos Flow conventions.
- Run tests and linters of your distribution as usual.

License
-------

[](#license)

This package is released under the terms of the MIT License. See the repository root `LICENSE` if available, or include your own license file for distribution.

CLI help
--------

[](#cli-help)

You can inspect available options and arguments via Flow's built-in help:

```
./flow help notification:sendmessage

```

This shows all flags accepted by the `notification:sendmessage` command.

Signals/Events
--------------

[](#signalsevents)

A Flow signal `notificationAdded` is emitted whenever a notification is created via the repository. You can react to it in your application, for example to forward the notification to another channel.

Example (pseudo-code):

```
// In some package of your distribution
namespace Your\Package;

use fucodo\Notification\Domain\Model\Notification;

class NotificationListener
{
    /**
     * @param Notification $notification The persisted notification entity
     */
    public function onNotificationAdded(Notification $notification): void
    {
        // e.g. push to a websocket, send an email, log, etc.
    }
}
```

Wire this listener to the `notificationAdded` signal via AOP configuration, for example in `Configuration/Objects.yaml` or an Aspect, depending on your project's conventions.

Uninstall / removal
-------------------

[](#uninstall--removal)

If you decide to remove the package, drop the database table after uninstalling the package:

```
DROP TABLE IF EXISTS fucodo_notification_domain_model_notification;

```

Then clear caches and update the schema as usual:

```
./flow flow:cache:flush
./flow doctrine:migrate

```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance47

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c6681704a769ab93a20ba54d94054d0f3f1e81b99341e8cfa29d91f6d8f16fb?d=identicon)[kaystrobach](/maintainers/kaystrobach)

---

Top Contributors

[![kaystrobach](https://avatars.githubusercontent.com/u/1185776?v=4)](https://github.com/kaystrobach "kaystrobach (13 commits)")

### Embed Badge

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

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

###  Alternatives

[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[eduardokum/laravel-mail-auto-embed

Library for embed images in emails automatically

1702.0M5](/packages/eduardokum-laravel-mail-auto-embed)

PHPackages © 2026

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