Open main menu

Extension:New User Email Notification/hooks/NewUserNotifBody

Available from version 1.5.2
Create text for message body of notification email
Define function:
public static function onNewUserNotifBody( $callobj , $MessageBody , $SiteName , $recipient , $user ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"NewUserNotifBody": "MyExtensionHooks::onNewUserNotifBody"

For MediaWiki ≤1.25:

$wgHooks['NewUserNotifBody'][] = 'MyExtensionHooks::onNewUserNotifBody';
Called from:File(s): NewUserNotif.class.php (extension NewUserNotif)

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:NewUserNotifBody extensions.


  • $callobj: The object (Class::NewUserNotifier) from which the call was made ($this).
  • $MessageBody: The string returned from this function that is the body message of the email to be delivered
  • $SiteName: The name of the site from which this email is being delivered
  • $recipient: The user name of the email recipient
  • $user: The object (Class::User) of the user for which this message is being generated


A full example can be found in the example extension ExtendedParamsExample.php included in Extension:NewUserNotif distribution.

See AlsoEdit