Manual:Hooks/EmailUserPermissionsErrors

EmailUserPermissionsErrors
Available from version 1.16.0
Retrieve permissions errors for emailing a user.
Define function:
public static function onEmailUserPermissionsErrors( $user, $editToken, &$hookErr ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"EmailUserPermissionsErrors": "MediaWiki\\Extension\\MyExtension\\Hooks::onEmailUserPermissionsErrors"
	}
}
Called from: File(s): specials/SpecialEmailUser.php
Interface: EmailUserPermissionsErrorsHook.php

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


Details edit

  • $user: The user who is trying to email another user.
  • $editToken: The user's edit token.
  • &$hookErr: Out-param for the error. Passed as the parameters to OutputPage::showErrorPage.