3 namespace MediaWiki\Mail\Hook
;
6 use MediaWiki\Mail\UserEmailContact
;
7 use MediaWiki\Permissions\Authority
;
11 * This is a hook handler interface, see docs/Hooks.md.
12 * Use the hook name "EmailUserSendEmail" to register handlers implementing this interface.
14 * @stable to implement
18 interface EmailUserSendEmailHook
{
20 * This hook is called before sending an email, when all other checks have succeeded.
22 * @param Authority $from
23 * @param MailAddress $fromAddress MailAddress of the sender
24 * @param UserEmailContact $to
25 * @param MailAddress $toAddress MailAddress of the target
26 * @param string $subject
28 * @param StatusValue $status Add any error here
29 * @return bool|void True or no return value to continue. To abort, return false and add a fatal error to $status.
31 public function onEmailUserSendEmail(
33 MailAddress
$fromAddress,
35 MailAddress
$toAddress,