synolia / sylius-admin-notification-plugin
Admin notifications for Sylius.
Package info
github.com/synolia/SyliusAdminNotificationPlugin
Type:sylius-plugin
pkg:composer/synolia/sylius-admin-notification-plugin
1.0.0
2026-08-12 12:18 UTC
Requires
- php: ^8.2
- ext-json: *
- sylius/sylius: ^2.0
- symfony/cache: ^6.4 || ^7.3 || ^8.0
- symfony/monolog-bundle: ^3.0
- symfony/notifier: ^6.4 || ^7.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.9
- php-parallel-lint/php-parallel-lint: ^1.3
- phpmd/phpmd: ^2.12
- phpro/grumphp: ^2.5
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^2.0
- phpstan/phpstan-doctrine: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpstan/phpstan-webmozart-assert: ^2.0
- phpunit/phpunit: ^9.5
- povils/phpmnd: ^3.0
- sebastian/phpcpd: ^6.0
- squizlabs/php_codesniffer: ^3.7
- symfony/browser-kit: ^6.4 || ^7.3
- symfony/debug-bundle: ^6.4 || ^7.3
- symfony/dotenv: ^6.4 || ^7.3
- symfony/web-profiler-bundle: ^6.4 || ^7.3
This package is auto-updated.
Last update: 2026-08-12 13:06:37 UTC
README
Admin Notification Plugin
Notification messages in your Sylius admin panel.
Features
- Add custom notification messages in your Sylius admin panel.
- Show list of notifications
Requirements
| Version | |
|---|---|
| PHP | ^8.2 |
| Sylius | ^2.0 |
Installation
-
Add the bundle and dependencies in your composer.json :
composer require synolia/sylius-admin-notification-plugin
-
Import routing in your project
config/routes/synolia_sylius_admin_notification.yaml:synolia_sylius_admin_notification_plugin: resource: "@SynoliaSyliusAdminNotificationPlugin/config/routes/admin_routing.yaml" prefix: '%sylius_admin.path_name%'
-
Apply plugin migrations to your database:
bin/console doctrine:migrations:migrate
How to create a notification
Send notification using Symfony notifier
<?php declare(strict_types=1); namespace App\Notification; use Symfony\Component\Notifier\Notification\Notification; use Symfony\Component\Notifier\NotifierInterface; final class SendTestNotification { private NotifierInterface $notifier; public function __construct(NotifierInterface $notifier) { $this->notifier = $notifier; } protected function send(string $title, string $content): void { $notification = (new Notification($title, ['chat/admin_notification'])) ->content($content); $this->notifier->send($notification); } }
Send notification using monolog handler
monolog: channels: ['synolia_sylius_admin_notification'] handlers: synolia_sylius_admin_notification: channels: [synolia_sylius_admin_notification] level: debug type: service id: Synolia\SyliusAdminNotificationPlugin\Handler\Monolog\AdminNotificationHandler
<?php declare(strict_types=1); namespace App\EnvieDeFraiseBundle\Command; use Psr\Log\LoggerInterface; final class SendTestNotification { private LoggerInterface $synoliaSyliusAdminNotificationLogger; public function __construct(LoggerInterface $synoliaSyliusAdminNotificationLogger) { $this->synoliaSyliusAdminNotificationLogger = $synoliaSyliusAdminNotificationLogger; } protected function execute(InputInterface $input, OutputInterface $output): int { $this->synoliaSyliusAdminNotificationLogger->critical('Notification message', [ 'context_1' => 'this is the first context', 'context_2' => [ 'key' => 'val' ], ]); } }
Write logs as notification
monolog: handlers: synolia_sylius_admin_notification: level: debug type: service id: Synolia\SyliusAdminNotificationPlugin\Handler\Monolog\AdminNotificationHandler main: type: fingers_crossed action_level: error handler: grouped channels: [ "!deprecation", "!sonata"] excluded_http_codes: [404, 405] buffer_size: 50 # How many messages should be saved? Prevent memory leaks grouped: type: group members: [ nested, deduplicated ] nested: type: stream path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug deduplicated: type: deduplication handler: synolia_sylius_admin_notification
Development
See How to contribute.
License
This library is under the EUPL-1.2 license.
Credits
Developed by Synolia.