Manual:Hooks/UserSendConfirmationMail
Appearance
From mediawiki.org
| UserSendConfirmationMail | |
|---|---|
| Available from version 1.33.0 (Gerrit change 493143) Called just before a confirmation email is sent to a user. Hook handlers can modify the email that will be sent. | |
| Define function: | public static function onUserSendConfirmationMail( User $user, array &$mail, array $info ) { ... } |
| Attach hook: | In extension.json:
{ "Hooks":{ "UserSendConfirmationMail":"MediaWiki\\Extension\\MyExtension\\Hooks::onUserSendConfirmationMail" } } |
| Called from: | File(s): user/User.php Function(s): sendConfirmationMail |
| Interface: | UserSendConfirmationMailHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:UserSendConfirmationMail extensions.
Details
[edit ]$user: The User object for which the confirmation email is going to be sent&$mail: Associative array describing the email, with the following keyssubject: Subject line of the emailbody: Email body. Can be a string, or an array with keys 'text' and 'html'from: User object, or null meaning $wgPasswordSender will be usedreplyTo: MailAddress object or null
$info: Associative array with additional informationtype: 'created' if the user's account was just created; 'set' if the user set an email address when they previously didn't have one; 'changed' if the user had an email address and changed itip: The IP address from which the user set/changed their email addressconfirmURL: URL the user should visit to confirm their emailinvalidateURL: URL the user should visit to invalidate confirmURLexpiration: time and date when confirmURL expires