[Mediawiki-l] Creating a notification?

Daniel Barrett danb at VistaPrint.com
Wed Mar 4 14:22:55 UTC 2009


What is the best practice for creating a new type of email notification that uses the business logic in the EmailNotification class? (That is, obeying user preferences, watchlist settings, minor edits, etc.)

For example, suppose we want to generate an email notification whenever an article is added to a category, for all users watching the category page.  In MediaWiki 1.13, it was possible to subclass EmailNotification and substitute a custom subject line and body for the email, and then call notifyOnPageChange(), but MediaWiki 1.14 has changed the subject & body members from public to private, making this impossible.  The class contains no hooks either.

One approach, taken by the existing Extension:CategoryWatcher, is to implement all your own business logic, duplicating EmailNotification's current capabilities. We don't like this solution, since it won't leverage any future changes in EmailNotification (or will just break in the future).

If there's no good solution, I'll file an enhancement request. It should be easy to leverage MediaWiki's notification system.

Any advice appreciated. Thanks.

DanB




More information about the MediaWiki-l mailing list