Skip to content

Document Mautic 8.0 class-name dispatch for PageBundle events - #648

Open
promptless-for-oss wants to merge 4 commits into
mautic:7.2from
Promptless:promptless/pr-17203-page-events-by-class
Open

Document Mautic 8.0 class-name dispatch for PageBundle events#648
promptless-for-oss wants to merge 4 commits into
mautic:7.2from
Promptless:promptless/pr-17203-page-events-by-class

Conversation

@promptless-for-oss

@promptless-for-oss promptless-for-oss commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Open in Promptless

Mautic 8.0 (mautic/mautic PR #17203) dispatches several PageBundle events by their event-object class name instead of the Mautic\PageBundle\PageEvents string constants, following the Symfony 4.3+ convention. This updates the developer-documentation subscriber examples so plugin developers use the key form that actually fires in 8.0, and warns anyone with an existing subscriber that it must be re-keyed.

  • plugin_extensions/landing_pages.rst: the PageDisplayEvent subscriber examples (PageSubscriber and PreferenceCenterSubscriber) now key getSubscribedEvents() on PageDisplayEvent::class, with notes explaining that a subscriber left on the old PageEvents::PAGE_ON_DISPLAY constant silently stops receiving the event (Mautic raises no error). A note in the Toggle 'Available for use' section explains that PAGE_ON_TOGGLE_PUBLISH and PAGE_ON_BUILD stay keyed on their string constants because they dispatch the shared PageEvent class.
  • mauticjs_api/tracking_script.rst: the TrackingSubscriber example now keys on TrackingEvent::class, with a matching note.

The PageEvents constants remain defined for backward compatibility but are no longer used internally to dispatch these events.

Trigger Events


Review feedback applied

  • @adiati98 ("we don't use the word 'will'. Please reword this.") on docs/mauticjs_api/tracking_script.rst: applied verbatim. Reworded "This will expose the payload..." to "This exposes the payload..." (present-tense active voice). This was the only use of "will" anywhere in this PR's diff, so no further rewording was needed.

PR mautic/mautic#17203 dispatches PageDisplayEvent and TrackingEvent by
their event-class name in Mautic 8.0. Update the plugin-extension and
tracking-script subscriber examples to key getSubscribedEvents() on
<Event>::class, and add notes explaining that a subscriber left on the
old PageEvents::* constant silently stops receiving the event. Leave
PAGE_ON_BUILD and PAGE_ON_TOGGLE_PUBLISH keyed on their string constants
(shared PageEvent class) and note why.
Comment thread docs/plugin_extensions/landing_pages.rst
Comment thread docs/plugin_extensions/landing_pages.rst
Comment thread docs/mauticjs_api/tracking_script.rst
Comment thread docs/mauticjs_api/tracking_script.rst Outdated
Comment thread docs/plugin_extensions/landing_pages.rst
Comment thread docs/plugin_extensions/landing_pages.rst
Comment thread docs/plugin_extensions/landing_pages.rst
Comment thread docs/plugin_extensions/landing_pages.rst
Comment thread docs/mauticjs_api/tracking_script.rst
Comment thread docs/mauticjs_api/tracking_script.rst
Comment thread docs/mauticjs_api/tracking_script.rst Outdated
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Thanks @adiati98 — on it. I'll reword to drop 'will' (present tense instead), check the rest of the diff for the same, run Vale, and push the update to this PR shortly.

@adiati98 adiati98 added this to the 8.0 milestone Sep 2, 2026
Applies @adiati98's review comment on PR mautic#648: Mautic style avoids 'will'.
Change is verb-tense only (will expose -> exposes) in
docs/mauticjs_api/tracking_script.rst.
Comment thread docs/mauticjs_api/tracking_script.rst
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Done @adiati98 — reworded "This will expose..." to "This exposes..." in docs/mauticjs_api/tracking_script.rst (the only use of 'will' in the diff). Pushed to this PR branch and Vale is clean. Ready for another look.

@promptless-for-oss
promptless-for-oss marked this pull request as ready for review September 2, 2026 18:03

@TomasVotruba TomasVotruba left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants