[Notifier] Disable notifications on failed messages by default
This commit is contained in:
parent
cf49a268b5
commit
4dd82d049b
@ -1516,6 +1516,7 @@ class Configuration implements ConfigurationInterface
|
||||
->prototype('scalar')->end()
|
||||
->end()
|
||||
->end()
|
||||
->booleanNode('notification_on_failed_messages')->defaultFalse()->end()
|
||||
->children()
|
||||
->arrayNode('channel_policy')
|
||||
->useAttributeAsKey('name')
|
||||
|
@ -1934,9 +1934,11 @@ class FrameworkExtension extends Extension
|
||||
$container->removeDefinition('notifier.channel.email');
|
||||
}
|
||||
|
||||
if (!$this->messengerConfigEnabled) {
|
||||
$container->removeDefinition('notifier.failed_message_listener');
|
||||
} else {
|
||||
if ($this->messengerConfigEnabled) {
|
||||
if ($config['notification_on_failed_messages']) {
|
||||
$container->getDefinition('notifier.failed_message_listener')->addTag('kernel.event_subscriber');
|
||||
}
|
||||
|
||||
// as we have a bus, the channels don't need the transports
|
||||
$container->getDefinition('notifier.channel.chat')->setArgument(0, null);
|
||||
$container->getDefinition('notifier.channel.email')->setArgument(0, null);
|
||||
|
@ -44,7 +44,6 @@
|
||||
|
||||
<service id="notifier.failed_message_listener" class="Symfony\Component\Notifier\EventListener\SendFailedMessageToNotifierListener">
|
||||
<argument type="service" id="notifier" />
|
||||
<tag name="kernel.event_subscriber" />
|
||||
</service>
|
||||
|
||||
<!-- chatter -->
|
||||
|
Reference in New Issue
Block a user