What is ResourceWatcher?¶
Resource Watcher is a plugin for MODX Revolution allowing you to send notification emails when a resource is created and/or updated.
- Installing from package manager
- Configure the proper system settings
Note: By default, the email address used to send the notifications is defined in the system settings (emailsender key). The name of the sender is the site name, defined in the system settings (site_name key).
Configuration - System Settings¶
|resourcewatcher.prefix||(string) - Prefix for placeholders used in the message chunk||rw.|
|resourcewatcher.new_active||(boolean) - Sets whether the plugin is active upon resource creation||false|
|resourcewatcher.new_email||(string) - Email address(es) to send the notifications to|
|resourcewatcher.new_hooks||(string) - List of hooks (snippets) to execute when a resource is created|
|resourcewatcher.new_subject||(string) - Subject of the notification emails||A new resource has been created|
|resourcewatcher.new_tpl||(string) - Chunk to use as the message of the e-mail when creating new resources||message-create|
|resourcewatcher.upd_active||(boolean) - Sets whether the plugin is active upon resource edition/update||false|
|resourcewatcher.upd_email||(string) - Email address(es) to send the notifications to|
|resourcewatcher.upd_hooks||(string) - List of hooks (snippets) to execute when a resource is updated|
|resourcewatcher.upd_subject||(string) - Subject of the notification emails||A resource has been updated|
|resourcewatcher.upd_tpl||(string) - Chunk to use as the message of the e-mail when updating a resource||message-update|
Placeholders (message chunks)¶
Placeholders (prefixed by default with "rw.") can be used in chunks used as a message. The available information/placeholders are the modUser, modUserProfile and modResource fields. Here is a small list (not exhaustive)
|prefix.id||ID of the resource|
|prefix.pagetitle||pagetitle field of the resource|
|prefix.username||name of the user who did the action|
|prefix.fullname||full name of the user who performed the action|
By default, all resources in all settings are "monitored". You can add constraints by using hooks (snippets).
The hooks are cumulative (and executed in the order in which you have filled in the System Setting).
Your hook should contain your constraints and return true if they are satisfied (otherwise false).
Github: https://github.com/meltingmedia/ResourceWatcher Bug reports/feature requests: https://github.com/meltingmedia/ResourceWatcher/issues