Document Mautic 8.0 class-name dispatch for the Campaign builder event - #643
Document Mautic 8.0 class-name dispatch for the Campaign builder event#643promptless-for-oss wants to merge 5 commits into
Conversation
Mautic 8.0 (mautic/mautic#17161) dispatches the CampaignBuilderEvent by its class name (Symfony 4.3 style). Update the plugin extension examples so subscribers key getSubscribedEvents() on CampaignBuilderEvent::class instead of the CampaignEvents::CAMPAIGN_ON_BUILD string constant, which no longer receives the event. Add a Mautic 8.0 note explaining the breaking change, fix the CampaignBuilderEvent namespace, and update the SMS batch-action cross-reference to match.
|
In the end, it would great to have just one section for all events constants => event classes, with single table. |
|
Thanks @TomasVotruba! Good call — one shared section with a single constant → event-class table instead of repeating the same explanation per bundle. We're working on consolidating it now and will push an update to this PR shortly. |
|
Quick update: we've scoped the change. Within this PR (which covers |
… with a table Address maintainer review on PR mautic#643: state the Mautic 8.0 class-name dispatch logic once and add a single scannable list-table mapping the former CampaignEvents::CAMPAIGN_ON_BUILD constant to the CampaignBuilderEvent::class subscription key, instead of repeating the same explanation in both an intro paragraph and a note.
|
Pushed the update to this PR: |
|
Thanks for the review, @TomasVotruba — good call. We've consolidated the repeated "constant → event class" explanation in the Campaign plugin docs into a single statement of the logic followed by one scannable table ( One scoping note: because this PR is tied to a single source PR (mautic/mautic#17161) under the one-docs-PR-per-source-PR convention, its table covers the Campaign event this PR owns; the same change is landing across a series of sibling docs PRs (one per bundle/source PR). If you'd prefer a single cross-bundle table on a shared page (e.g. |
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.
|
/aside @TomasVotruba Promptless has made a new change based on your last comment. Can you please review it? Thank you! |
Open in Promptless
Mautic 8.0 dispatches the
CampaignBuilderEventby its class name (Symfony 4.3 style), so a Plugin that registers a Campaign Action, Condition, or Decision must keygetSubscribedEvents()onCampaignBuilderEvent::class. A subscriber still keyed on theCampaignEvents::CAMPAIGN_ON_BUILDstring constant no longer receives the event, even though that constant remains defined in Mautic's code — a silent break for out-of-tree Plugins upgrading to Mautic 8.0.This updates the plugin extension docs to reflect that change: the "Registering Campaign Events" section now states the class-name dispatch and the silent breaking change once, followed by a single scannable table mapping the former
CampaignEvents::CAMPAIGN_ON_BUILDconstant to theCampaignBuilderEvent::classsubscription key. The six Action/Condition/Decision examples key onCampaignBuilderEvent::class(and drop the now-unusedCampaignEventsimport), theCampaignBuilderEventnamespace directive is corrected to the singularEvent, and the SMS batch-action cross-reference is updated to match. The Plugin's own custom events registered viabatchEventName/eventNameare dispatched by the Campaign engine by string name and are unchanged, so those subscription keys stay as string constants.Addressing review feedback (@TomasVotruba)
Re: "it would great to have just one section for all events constants => event classes, with single table … Logic is always the same, no need to repeat it 👍"
campaigns.rstinto one statement of the logic, followed by a singlelist-tablethat gives the replacement at a glance. The duplicate note that restated the same logic is gone.docs/plugins/event_listeners.rst) as a follow-up if you'd prefer that over per-bundle tables; flagging rather than merging the sibling PRs' content here.Trigger Events