Extension:EmailDiff

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

Release status:Extension status stable

ImplementationTemplate:Extension#type Notify
DescriptionTemplate:Extension#description Send textual diffs of page changes inside the notification emails
Author(s)Template:Extension#username Greg Sabino Mullane (Turnsteptalk)
Latest versionTemplate:Extension#version 1.7 (February 23, 2016)
MediaWikiTemplate:Extension#mediawiki >= 1.25
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license MIT License
Download EmailDiff.1.7.tar.gz PGP signature
ParametersTemplate:Extension#parameters

$wgEmailDiffSubjectSuffix, $wgEmailDiffCommand

Hooks usedTemplate:Extension#hook
SendPersonalizedNotificationEmail

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

Check usage and version matrix.

The EmailDiff extension modifies outgoing notification emails by providing a text diff of all changes made. This enables you to see the changes without having to leave your mail client.

Installation[edit]

  • Download and place the file(s) in a directory called EmailDiff in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'EmailDiff' );
    
    A new hook will need to be added to the file includes/mail/EmailNotification.php. Inside the function sendPersonalized, right before the "return" line, add:
Hooks::run( 'SendPersonalizedNotificationEmail',
    [ $watchingUser, $this->oldid, $this->title, &$headers, &$this->subject, &$body ] );
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Edit the template[edit]

The extension works by replacing the word $PAGEDIFF in the email notification template with the actual diff. Therefore, you will need to edit the MediaWiki:Enotif_body page on your wiki to add that string. It is recommended that you put some short summary information at the top before the diff. Here is one suggested layout:

Page: $PAGETITLE
Summary: $PAGESUMMARY $PAGEMINOREDIT
User: $PAGEEDITOR  Time: $PAGEEDITDATE
$PAGEDIFF
$NEWPAGE

Configuration parameters[edit]

If you need to change these, add them to your LocalSettings.php after the wfLoadExtension command above:

  • $wgEmailDiffSubjectSuffix - String to be added to the end of the subject line. Defaults to (diff)
  • $wgEmailDiffCommand - Command to perform the diff. Seldom needs to be changed from the default.