From 89b5af69f538064e6ecb95196c441c50917ba2d3 Mon Sep 17 00:00:00 2001 From: "promptless[bot]" Date: Mon, 31 Aug 2026 14:32:40 +0000 Subject: [PATCH 1/5] Key ChannelBundle event subscribers on the event class (Mautic 8.0) Update the plugin Channels extension examples for the Mautic 8.0 class-name event dispatch introduced in mautic/mautic#17201: key subscribers on ChannelEvent::class and ChannelBroadcastEvent::class instead of the ChannelEvents string constants, drop the now-unused import, and correct the broadcast listener reference to the event class. Add a note explaining that subscribers keyed on the old ChannelEvents constants silently stop receiving these events. --- docs/plugin_extensions/channels.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/plugin_extensions/channels.rst b/docs/plugin_extensions/channels.rst index e3956d62f..650fb714b 100644 --- a/docs/plugin_extensions/channels.rst +++ b/docs/plugin_extensions/channels.rst @@ -29,7 +29,7 @@ You can find several events through the ``ChannelEvents`` class. public static function getSubscribedEvents() { return [ - ChannelEvents::ADD_CHANNEL => ['onAddChannel', 100], + ChannelEvent::class => ['onAddChannel', 100], ]; } @@ -56,13 +56,17 @@ You can find several events through the ``ChannelEvents`` class. ); } +.. note:: + + From Mautic 8.0, Mautic dispatches and subscribes to these ChannelBundle events by their event class name (for example ``ChannelEvent::class``) rather than the ``ChannelEvents`` constant. A subscriber still keyed on the old ``ChannelEvents`` constant silently stops receiving the event, so re-key it on the event class. The ``ChannelEvents`` constants stay defined for backward compatibility but no longer route dispatch for these events. + Extending broadcasts -------------------- Broadcasts are communications sent in bulk through a Channel such as Email. An event is available to execute the sending of these bulk communications via the ``mautic:broadcasts:send`` command. -To hook into the ``mautic:broadcasts:send`` command, create a listener for the ``\Mautic\CoreBundle\CoreEvents::CHANNEL_BROADCAST`` event. +To hook into the ``mautic:broadcasts:send`` command, create a listener for the ``\Mautic\ChannelBundle\Event\ChannelBroadcastEvent`` event. The event listener should check for the appropriate context and ID. .. code-block:: php @@ -74,7 +78,6 @@ The event listener should check for the appropriate context and ID. namespace MauticPlugin\HelloWorldBundle\EventListener; - use Mautic\ChannelBundle\ChannelEvents; use Mautic\ChannelBundle\Event\ChannelBroadcastEvent; use MauticPlugin\HelloWorldPlugin\Model\WorldModel; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -91,7 +94,7 @@ The event listener should check for the appropriate context and ID. public static function getSubscribedEvents(): array { return [ - ChannelEvents::CHANNEL_BROADCAST => ['onChannelBroadcast', 0] + ChannelBroadcastEvent::class => ['onChannelBroadcast', 0], ]; } From 1dff7a69f76d5282c0f83ba88cb6d40f0dd1cbe7 Mon Sep 17 00:00:00 2001 From: "promptless[bot]" Date: Wed, 2 Sep 2026 07:59:31 +0000 Subject: [PATCH 2/5] Use hyphen aside instead of parentheses in ChannelBundle note Applies maintainer @adiati98's review on PR #644: the dev-docs corpus sets off mid-sentence 'for example' asides with paired spaced hyphens (docs/design/labelling.rst), not parentheses. --- docs/plugin_extensions/channels.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugin_extensions/channels.rst b/docs/plugin_extensions/channels.rst index 650fb714b..fe8e1673f 100644 --- a/docs/plugin_extensions/channels.rst +++ b/docs/plugin_extensions/channels.rst @@ -58,7 +58,7 @@ You can find several events through the ``ChannelEvents`` class. .. note:: - From Mautic 8.0, Mautic dispatches and subscribes to these ChannelBundle events by their event class name (for example ``ChannelEvent::class``) rather than the ``ChannelEvents`` constant. A subscriber still keyed on the old ``ChannelEvents`` constant silently stops receiving the event, so re-key it on the event class. The ``ChannelEvents`` constants stay defined for backward compatibility but no longer route dispatch for these events. + From Mautic 8.0, Mautic dispatches and subscribes to these ChannelBundle events by their event class name - for example, ``ChannelEvent::class`` - rather than the ``ChannelEvents`` constant. A subscriber still keyed on the old ``ChannelEvents`` constant silently stops receiving the event, so re-key it on the event class. The ``ChannelEvents`` constants stay defined for backward compatibility but no longer route dispatch for these events. Extending broadcasts -------------------- From 7997b17d40b55339e01729b2a3fecfddf41f8856 Mon Sep 17 00:00:00 2001 From: "promptless[bot]" Date: Fri, 4 Sep 2026 07:31:50 +0000 Subject: [PATCH 3/5] Shorten ChannelBundle event note and attribute to Symfony 4.3 Applies @escopecz's review on PR #644: shorten the note added after the first subscriber example and state that keying subscribers on the event class is the Symfony convention since Symfony 4.3. Drops the silent-failure warning and backward-compatibility framing. --- docs/plugin_extensions/channels.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugin_extensions/channels.rst b/docs/plugin_extensions/channels.rst index fe8e1673f..bb53665db 100644 --- a/docs/plugin_extensions/channels.rst +++ b/docs/plugin_extensions/channels.rst @@ -58,7 +58,7 @@ You can find several events through the ``ChannelEvents`` class. .. note:: - From Mautic 8.0, Mautic dispatches and subscribes to these ChannelBundle events by their event class name - for example, ``ChannelEvent::class`` - rather than the ``ChannelEvents`` constant. A subscriber still keyed on the old ``ChannelEvents`` constant silently stops receiving the event, so re-key it on the event class. The ``ChannelEvents`` constants stay defined for backward compatibility but no longer route dispatch for these events. + From Mautic 8.0, key subscribers to these ChannelBundle events on the event class—for example, ``ChannelEvent::class``—following the Symfony convention for dispatching events by class name since Symfony 4.3. Extending broadcasts -------------------- From 11992a6ec5b6648a7e86c856b522da091ef0d4ff Mon Sep 17 00:00:00 2001 From: "promptless[bot]" Date: Mon, 7 Sep 2026 11:17:59 +0000 Subject: [PATCH 4/5] Use hyphens instead of em dashes in ChannelBundle event note Applies reviewer @adiati98's suggestion on PR #644: replace the two em dashes around ChannelEvent::class with space-hyphen-space. --- docs/plugin_extensions/channels.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugin_extensions/channels.rst b/docs/plugin_extensions/channels.rst index bb53665db..41b2cd525 100644 --- a/docs/plugin_extensions/channels.rst +++ b/docs/plugin_extensions/channels.rst @@ -58,7 +58,7 @@ You can find several events through the ``ChannelEvents`` class. .. note:: - From Mautic 8.0, key subscribers to these ChannelBundle events on the event class—for example, ``ChannelEvent::class``—following the Symfony convention for dispatching events by class name since Symfony 4.3. + From Mautic 8.0, key subscribers to these ChannelBundle events on the event class - for example, ``ChannelEvent::class`` - following the Symfony convention for dispatching events by class name since Symfony 4.3. Extending broadcasts -------------------- From b95c6405d7bacf085eb68591c4656188c8c7c54f Mon Sep 17 00:00:00 2001 From: "promptless[bot]" Date: Wed, 9 Sep 2026 16:52:51 +0000 Subject: [PATCH 5/5] Reference the shared Mautic 8 class-name dispatch section Replace this page's copy of the general Mautic 8 class-name event dispatch explanation with a cross-reference to the shared "Mautic 8: class-name event dispatch" section in plugins/event_listeners.rst, keeping the bundle-specific facts. Part of consolidating the duplicated note across the open Mautic 8 dev-docs PRs. --- docs/plugin_extensions/channels.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugin_extensions/channels.rst b/docs/plugin_extensions/channels.rst index 41b2cd525..042d8af55 100644 --- a/docs/plugin_extensions/channels.rst +++ b/docs/plugin_extensions/channels.rst @@ -58,7 +58,7 @@ You can find several events through the ``ChannelEvents`` class. .. note:: - From Mautic 8.0, key subscribers to these ChannelBundle events on the event class - for example, ``ChannelEvent::class`` - following the Symfony convention for dispatching events by class name since Symfony 4.3. + From Mautic 8.0, ChannelBundle events key on the event class - for example, ``ChannelEvent::class`` and ``ChannelBroadcastEvent::class``. For the rationale, see :ref:`Mautic 8 class-name event dispatch `. Extending broadcasts --------------------