Extension:EditNotify

From mediawiki.org
MediaWiki extensions manual
EditNotify
Release status: stable
Implementation Notify
Description Extension for page creation/editing notifications
Author(s) Abhinand and Yaron Koren
Latest version 1.0.0 (2020-03-19)
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.35+
PHP 5.3 or later
License MIT License
Download
  • $wgEditNotifyEnableFoo
  • $wgEditNotifyAlerts
Quarterly downloads 15 (Ranked 148th)
Translate the EditNotify extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

EditNotify is an extension to MediaWiki that allows users to receive notifications while creating and editing a page. The extension makes use of the Echo extension to notify the users.

Features[edit]

The extension allows registered user to get notified for:

  • Creation of new pages
  • Edit to existing pages - It includes notification to all changes.
  • Change in specific template field - Users get the notification when there is a change in template field
  • Change in specific template field to specific template value - Users are notified when there is a change in template field value

All users who are subscribed for any of the event listed above will be notified for them with a simple alert message (Echo notification) as well as an email. The possible sets of pages for which users can choose to be notified are:

  • All pages - keep track of change or creation of all pages.
  • All pages in one or more namespaces
  • All pages in one or more categories

Requirements[edit]

  • Install Echo - EditNotify extension makes use of Echo notifications to notify the subscribed users of page creation/editing.

Installation[edit]

  • Download and place the file(s) in a directory called EditNotify in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'EditNotify' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage[edit]

  • The array $wgEditNotifyAlerts should be added to the LocalSettings.php and the username can be added to the respective array to get notified of the corresponding events.
  • New field name or field name to a specific field value can be added if you wish to track the changes. Namespaces or categories to be tracked can also be added to the respective 'namespace' or 'category' keys in the array.
  • If user wishes to receive notification of all pages, then the category and namespace keys can be avoided.
$wgEditNotifyAlerts = array(
	array(
		'action' => 'create',
		'users' => array('user1', 'user2')
	),
	array(
		'action' => 'edit',
		'namespace' => 'namespace name',
		'users' => array('user2')
	),
	array(
		'action' => 'edit',
		'namespace' => 'namespace name',
		'category' => 'category name',
		'users' => array('user1')
	),
	array(
		'action' => 'edit',
		'namespace' => 'namespace name',
		'category' => 'category name',
		'template' => 'template name',
		'templateField' => 'field name',
		'users' => array('user1', 'user2')
	),
	array(
		'action' => 'edit',
		'namespace' => 'namespace name',
		'category' => 'category name',
		'template' => 'template name',
		'templateField' => 'field name',
		'templateFieldValue' => 'field value',
		'users' => array('user1', 'user2')
	),
	...
);
Email notification when there is a change in template field to specific value

Examples[edit]

Users can get notified of the create and edit event of all pages. In the below example, Joe will get notified if any page is created, or edited.

array(
		'action' => array( 'create', 'edit' ),
		'users' => array( 'Joe' )
	),

Say, if users David and Ram have to get notified when a page is created, and the user John has to get notified when a non template page in 'User' namespace is edited and Charles has to track edit event in 'Uniwiki' category, then the array would something like:

$wgEditNotifyAlerts = array(
	array(
		'action' => 'create',
		'users' => array('David', 'Ram')
	),
	array(
		'action' => 'edit',
		'namespace' => 'User',
		'users' => array('John')
	),
	array(
		'action' => 'edit',
		'category' => 'Uniwiki',
		'users' => array('Charles')
	),
    ....
....

George and Ann will get notified of the change in template value if the field value of 'full name' changes in template 'User info' in 'User' and 'Talk' namespaces. While Mia will be notified for change in field value of 'full name' in template 'User info' in any page.

 ...
    ....
   	array(
		'action' => 'edit',
		'namespace' => array('User', 'Talk'),
		'template' => 'User info',
		'templateField' => 'full name',
		'users' => array('George', 'Ann')
	),
		array(
		'action' => 'edit',
		'template' => 'User info',
		'templateField' => 'full name',
		'users' => array('Mia')
	),
    ....
    ...

If the value of 'full name' changes to 'Albert' in 'User' namespace, then Brennan will be notified of this event.

   	array(
		'action' => 'edit',
		'namespace' => 'User',
		'template' => 'User info',
		'templateField' => 'full name',
		'templateFieldValue' => 'Albert',
		'users' => array('Brennan')
	),
	...

New arrays can be added in $wgEditNotifyAlerts to get notified of the required event.

Issues of the extension[edit]

  • Users can get notified when a page is created in any of namespace or category, but user cannot track a particular namespace or category. So when you are subscribing for 'create' page notifications, don't include 'namespace' or 'category' within the individual array for that notification.[1]

See also[edit]

References[edit]