Skip to content

Commit 61d1c4e

Browse files
benr77fabpot
authored andcommitted
[Notifier] Add Importance level to flash message type
Instead of hard-coding the flash message type, set the flash message type based on the "importance" level of the notification.
1 parent 7c50fc6 commit 61d1c4e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Resources/config/notifier.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\Notifier\ChatterInterface;
2323
use Symfony\Component\Notifier\EventListener\NotificationLoggerListener;
2424
use Symfony\Component\Notifier\EventListener\SendFailedMessageToNotifierListener;
25+
use Symfony\Component\Notifier\FlashMessage\DefaultFlashMessageImportanceMapper;
2526
use Symfony\Component\Notifier\Message\ChatMessage;
2627
use Symfony\Component\Notifier\Message\PushMessage;
2728
use Symfony\Component\Notifier\Message\SmsMessage;
@@ -43,8 +44,11 @@
4344
->set('notifier.channel_policy', ChannelPolicy::class)
4445
->args([[]])
4546

47+
->set('notifier.flash_message_importance_mapper', DefaultFlashMessageImportanceMapper::class)
48+
->args([[]])
49+
4650
->set('notifier.channel.browser', BrowserChannel::class)
47-
->args([service('request_stack')])
51+
->args([service('request_stack'), service('notifier.flash_message_importance_mapper')])
4852
->tag('notifier.channel', ['channel' => 'browser'])
4953

5054
->set('notifier.channel.chat', ChatChannel::class)

0 commit comments

Comments
 (0)