Skip to content

docs: Port "Event dispatcher" service page to 7.2#588

Open
promptless-for-oss wants to merge 1 commit into
mautic:7.2from
Promptless:promptless/docs-issue-351-event-dispatcher-7.2
Open

docs: Port "Event dispatcher" service page to 7.2#588
promptless-for-oss wants to merge 1 commit into
mautic:7.2from
Promptless:promptless/docs-issue-351-event-dispatcher-7.2

Conversation

@promptless-for-oss

Copy link
Copy Markdown
Contributor

Open this suggestion in Promptless to view citations and reasoning process

Ports the "Event dispatcher" plugin service page from the legacy dev docs into RST on the 7.2 base branch (issue #351, content from 7.1 source). Replaces the placeholder note with a modern Mautic 7 example that injects EventDispatcherInterface and uses the current dispatch() argument order, plus a cross-reference to the Custom events section. Adds a label anchor to plugins/event_listeners.rst so the cross-reference resolves.

Trigger Events


Tip: See how your feedback shapes Promptless in Agent Knowledge Base 🧠

.. vale on No newline at end of file
.. vale on

Use the event dispatcher to dispatch your Plugin's custom events. Inject ``Symfony\Component\EventDispatcher\EventDispatcherInterface`` into your service, and always type-hint the interface since the concrete class can differ between environments:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ported the legacy _plugin_services_event_dispatcher.md content per issue #351/#350: kept the event_dispatcher service and its HelloWorldEvents::ARMAGEDDON / ArmageddonEvent example, but modernized it to inject Symfony\Component\EventDispatcher\EventDispatcherInterface and use the Mautic 7 dispatch(event, name) argument order instead of the legacy dispatch(name, event) order.

Source: https://github.com/mautic/developer-documentation/blob/main/source/includes/_plugin_services_event_dispatcher.md

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(Line 47)

Reused the already-reviewed 7.1 port of this page as the source content for the 7.2 base branch, matching the team's decision in the Slack thread to author against 7.2 using the 7.1 issue content. Repointed the Custom events cross-reference to a new dispatch custom events label in plugins/event_listeners.rst because plugin_miscellaneous/events.rst is still a placeholder stub on 7.2 and has no such section anchor.

Source: https://github.com/mautic/developer-documentation-new/blob/7.1/docs/plugin_services/event_dispatcher.rst

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant