Make your module's notifications count as System
How the notification bell sorts notices into System and Extensions, and how your module's notices stay in System.
The notification bell has two tabs. System holds the platform's own notices and is the only tab the bell's count covers. Extensions holds the notices other vendors write into the admin inbox and the system messages their modules register; a merchant can mute a vendor there. This recipe is for a module whose notices belong to the platform side of the shop, such as a bundled module, a brand package or an integration the shop can't run without. Their notices should stay in System, where a merchant never mutes them by accident.
When to use it
- Your module writes admin notifications or registers a system message, and the merchant has to see them. Keep them few and useful (Built for Light, rule 1).
- Your module ships with the platform or with Light's distribution, not as a separate extension the merchant chose.
A module that is a normal extension needs nothing: its notices land in Extensions under its vendor name, and the merchant decides.

How a notice is tagged
Light records which module wrote each inbox notification. A plugin on the inbox resource's parse() (feeds, Inbox::add* and the notifier) and save() (a notice saved straight from an inbox model) finds the writer from the call stack at write time: the first frame outside the inbox, the framework and the plugins that wrap the inbox write. A plugin of yours on another class that writes a notice is the writer and is named by its module. It stores the module name, such as Acme_Hello, in the table mrx_notification_source. A feed module that inherits its fetch from a shared base is named by its own class, not the base.
A system message is classified by the module of its message class. A bulk task (an "Update attributes" run) is always System.
Rows written before 0.18.0 have no tag. Light reads their link instead: a row without a link, with a relative link, or with a link to the shop's own host or a host in the pool notification_system_hosts is System. A host in the pool matches only itself. Any other host makes it an extension, muted as host:<host>. A notice the classifier can't name counts as System, so an unknown origin is never hidden.
What counts as System
Three pools hold plain strings, keyed by any code you like. Light's defaults hold the platform's vendors, a few bundled modules and the platform's news hosts.
| Pool | Item value | Example |
|---|---|---|
notification_system_vendors | A vendor, the part of the module name before the underscore | Acme |
notification_system_modules | A whole module name | Acme_Hello |
notification_system_hosts | A host, optionally with a first path segment, lower-case, no scheme; it matches only itself, a leading dot (.acme.example) also matches its subdomains | docs.acme.example |
A module wins over its vendor: listing Acme_Hello makes that module System while the rest of Acme stays an extension. A vendor can't be muted while it is in notification_system_vendors.
Add your vendor from your own module's etc/adminhtml/di.xml; Mrx_Ai does it for its own vendor, and a module of yours does the same with its vendor name. The item goes away with your module, so a shop that removes it loses the entry too.
<type name="Mrx\Light\Model\Notifications\SystemSources">
<arguments>
<argument name="vendors" xsi:type="array">
<item name="Disrex" xsi:type="string">Disrex</item>
</argument>
</arguments>
</type>Use modules for a single module and hosts for the links of notices written before 0.18.0. The hosts pool only matters for those old rows: a tagged row is classified by its module.
What muting does, and does not do
A merchant mutes a vendor, a host or all extensions with the buttons in the Extensions tab. Light stores the list in mrx_light/notifications/muted at default scope, through the route light/notifications/mute, which needs the right to remove admin notifications.
- A mute hides items in the bell and leaves them out of its count. It is shop-wide, like the inbox's read flag, not per admin.
- "See all notifications" still lists everything. The vendor's own feed keeps fetching; nothing is deleted.
- System items can't be muted. The route answers 422 for them.
- Unmuting shows the items again at once. Unmuting "all extensions" keeps the single mutes.
Don't write the config path yourself: the route validates the ids and cleans the config cache.
The gap, and a deploy note
Notices written before the shop ran 0.18.0 carry no tag, so a vendor's old row is sorted by its link only. Unlinked old rows stay in System. Nothing rewrites them.
The tagging plugin is global, because feeds run in cron and the CLI. A shop that uses creatuity/magento2-interceptors has each class's plugin list baked into its interceptor, so a deploy must regenerate the compiled plugins: setup:di:compile in production. On a development shop, delete generated/metadata/staticcache/*_compiled_plugins.php and the inbox resource's interceptor under generated/code, then clean the config cache. Without it nothing is tagged and every new row reads as untagged.
On Mage-OS 4.0 Magento_AdminNotification can't be removed, because Magento_AsynchronousOperations needs its classes and Catalog, Customer and SalesRule require AsynchronousOperations. A shop that wants no notifications switches the module off. Light's plugin then does nothing, because it checks that the module is enabled before any SQL, and its constructor names no AdminNotification type, so it compiles either way. Without the module there is no bell.
Last updated on