Extension:New User Email Notification
This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. If you are interested in taking on the task of developing and maintaining this extension, you can request repository ownership. As a courtesy, you may want to contact the author. You should also remove this template and list yourself as maintaining the extension in the page's {{Extension}} infobox. |
Release status: unmaintained | |
|---|---|
| Implementation | Notify, Hook |
| 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+ |
| PHP | 7.2+ |
| Database changes | No |
| License | GNU General Public License 2.0 or later |
| Download | README |
| |
| Translate the New User Email Notification extension if it is available at translatewiki.net | |
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
- Download and move the extracted
NewUserNotiffolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/NewUserNotif
- Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'NewUserNotif' );
- Configure the extension as required
- Customise the notification email as required
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
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
| Parameter | Value |
|---|---|
| $1 | Site name |
- MediaWiki
- Newusernotifbody
Body text
| Parameter | Value |
|---|---|
| $1 | Username of the recipient |
| $2 | Username of the new account |
| $3 | Site name |
| $4 | Date/time of account creation |
| $5 | Date of account creation |
| $6 | Time of account creation |
Further customization
Using hooks, 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. This involves creating a sort of extension to the NewUserNotif extension, ideally in one file. You would then include the new extension in your LocalSettings.php after the inclusion of NewUserNotif:
wfLoadExtension( 'NewUserNotif' ); require_once "$IP/extensions/NewUserNotif/[yourExtendedParamsExample].php"; The available hooks are:
- NewUserNotifBody - Create text for message body of notification email
- NewUserNotifSubject - Create text for the subject line of the new user notification email
An example extension that uses these hooks is included in the distribution as "ExtendedParamsExample.php". The easiest way to create your own code is to create a copy of this file and rename it to something meaningful to your site(s). For more details, see this customization example.
| This extension is included in the following wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |
