Extension:EditNotify

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
EditNotify

Release status:Extension status beta

Alert notification from EditNotify.png
ImplementationTemplate:Extension#type Notify
DescriptionTemplate:Extension#description Extension for page creation/editing notifications
Author(s)Template:Extension#username Abhinand and Yaron Koren
MediaWikiTemplate:Extension#mediawiki 1.25+
PHPTemplate:Extension#php 5.3 or later
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
ParametersTemplate:Extension#parameters

$wgEditNotifyAlerts

Hooks usedTemplate:Extension#hook
BeforeCreateEchoEventManual:Hooks/BeforeCreateEchoEvent
PageContentSaveManual:Hooks/PageContentSave
EchoGetDefaultNotifiedUsers
PageContentInsertCompleteManual:Hooks/PageContentInsertComplete

Translate the EditNotify extension if it is available at translatewiki.net

Check usage and version matrix.

IssuesPhabricator

Open tasks · Report a bug

EditNotify is an extension to MediaWiki that allow users to receive notification while creating and editing a page. The extension makes use of 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:
require_once "$IP/extensions/EditNotify/EditNotify.php";
  • 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',
		'namespace' => 'namespace name',
		'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.

See also[edit]