Extension:New User Email Notification

Category:Unmaintained extensions#New%20User%20Email%20Notification Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:GPL licensed extensions
MediaWiki extensions manual
New User Email Notification
Release status: unmaintainedCategory:Unmaintained extensions
Implementation NotifyCategory:Notification extensions, Hook Category:Hook extensions
Description Sends email notification when user accounts are created
Author(s) Rob Churchtalk
Universal Omegatalk
Latest version 1.7.0 (2021-4-15)
MediaWiki 1.35+Category:Extensions with manual MediaWiki version
PHP 7.2+
Database changes No
License GNU General Public License 2.0 or later
Download Category:Extensions in Wikimedia version control
README
  • $wgNewUserNotifTargets
  • $wgNewUserNotifEmailTargets
  • $wgNewUserNotifSender
Translate the New User Email Notification extension if it is available at translatewiki.net
Category:All extensions

The New User Email Notification extension sends a customisable email to specified recipients when a new user account is created. The extension can send to multiple users, and additional email addresses, and is useful for keeping track of account creation on a small wiki.

Installation

To users running MediaWiki 1.35 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.35 and earlier), instead of wfLoadExtension( 'NewUserNotif' );, you need to use:

require_once "$IP/extensions/NewUserNotif/NewUserNotif.php";

Configuration

The behaviour of the extension, including notification recipients, is managed using the configuration variables below:

$wgNewUserNotifTargets
Array containing the usernames or identifiers of those who should receive a notification email; defaults to the first user (usually the wiki's primary administrator)
$wgNewUserNotifEmailTargets
Array containing email addresses to which a notification should also be sent
  • $wgNewUserNotifSender
Email address of the sender of the email; defaults to the value of $wgPasswordSender

For example, you could add this to the "LocalSettings.php" file:

$wgNewUserNotifEmailTargets = [
    'your_email_address@example.com'
];

Customisation

The subject and text of the notification email sent to each recipient can be customised using two messages:

MediaWiki
Newusernotifsubj

Subject line

ParameterValue
$1Site name
MediaWiki
Newusernotifbody

Body text

ParameterValue
$1Username of the recipient
$2Username of the new account
$3Site name
$4Date/time of account creation
$5Date of account creation
$6Time of account creation

Further Customisation

You can fully customize both the subject line and the message body, including adding new parameters which can be passed into both of those generators starting in version 1.5.2.

Starting in 1.5.2, you can also extend the message customisation by using hooks added to the extension which allow you to create new subject and body text without hacking the extension code.

This involves creating an extension to the NewUserNotif extension. For this example, the extension file "ExtendedParamsExample.php" can be found in the extension distribution. It is recommended you create a copy of this file and rename it to something meaningful to your site(s).

You would then include the new extension in your localsettings.php after you included the NewUserNotif.php.

. . .
wfLoadExtension( 'NewUserNotif' );
require_once "$IP/extensions/NewUserNotif/[yourExtendeParamsExample].php";
. . .

This available hooks are:

FunctionVersionHookDescription
New User Email Notification 1.5.2 NewUserNotifBodyCreate text for message body of notification email
1.5.2 NewUserNotifSubject Create text for the subject line of the new user notification email

An example extension that uses this is included in the distribution as "ExtendedParamsExample.php". For more details, see this Customisation example.

Category:All extensions Category:Extensions in Wikimedia version control Category:Extensions included in Miraheze Category:Extensions included in WikiForge Category:Extensions still supporting pre-registration versions Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:GPL licensed extensions Category:Hook extensions Category:LocalUserCreated extensions Category:Notification extensions Category:Unmaintained extensions