vestnik.dispatcher is installed with the component. It listens to the MODX system events it is attached to, turns their data into placeholders and passes it to Vestnik. Without an event attached and without a rule the plugin does nothing.
How to use it
- Attach the plugin to an event: Elements → Plugins → vestnik.dispatcher → System Events → tick the ones you need (for example
OnWebLogin,OnDocPublished) → Save. After installation the plugin is attached toOnUserActivateandOnManagerLogin. - Create a rule whose “Event key” is the exact MODX event name, for example
OnUserActivate(case-sensitive). - Use the event placeholders in the template (table below).
Placeholders
| MODX event | Placeholders |
|---|---|
| Any (always) | [[+event]], [[+site_name]], [[+site_url]] |
OnUserActivate, OnUserSave, OnUserRemove, OnUserFormSave, OnWebLogin, OnManagerLogin | [[+user_id]], [[+username]], [[+email]], [[+fullname]] |
OnDocPublished, OnDocFormSave | [[+resource_id]], [[+pagetitle]], [[+longtitle]], [[+url]] |
In addition, all scalar properties of the event get into the template under their own names.
Common mistakes
- The event key in the rule does not match the MODX event name (case matters) — the rule never fires.
- Saving a user in the manager fires
OnUserFormSave, notOnUserSave. - Nothing arrives — turn on
vestnik_debug_mode: the MODX error log will show[Vestnik]lines telling whether the event fired and how many rules matched. In this mode all emails go tovestnik_debug_email, and without it they are not sent.