| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\User\Hook; |
| 4 | |
| 5 | use MediaWiki\User\User; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "UserSendConfirmationMail" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup Hooks |
| 13 | */ |
| 14 | interface UserSendConfirmationMailHook { |
| 15 | /** |
| 16 | * This hook is called just before a confirmation email is sent to a user. |
| 17 | * |
| 18 | * Hook handlers can modify the email that will be sent. |
| 19 | * |
| 20 | * @since 1.35 |
| 21 | * |
| 22 | * @param User $user The User for which the confirmation email is going to be sent |
| 23 | * @param array &$mail Associative array describing the email, with the following keys: |
| 24 | * - subject: Subject line of the email |
| 25 | * - body: Email body. Can be a string, or an array with keys 'text' and 'html' |
| 26 | * - from: User object, or null meaning $wgPasswordSender will be used |
| 27 | * - replyTo: MailAddress object or null |
| 28 | * @param array $info Associative array with additional information: |
| 29 | * - type: 'created' if the user's account was just created; 'set' if the user |
| 30 | * set an email address when they previously didn't have one; 'changed' if |
| 31 | * the user had an email address and changed it |
| 32 | * - ip: The IP address from which the user set/changed their email address |
| 33 | * - confirmURL: URL the user should visit to confirm their email |
| 34 | * - invalidateURL: URL the user should visit to invalidate confirmURL |
| 35 | * - expiration: time and date when confirmURL expires |
| 36 | * @return bool|void True or no return value to continue or false to abort |
| 37 | */ |
| 38 | public function onUserSendConfirmationMail( $user, &$mail, $info ); |
| 39 | } |