wiki.techinc.nl/includes/mail/Hook/EmailUserSendEmailHook.php
Daimona Eaytoy c7eb0db5d1 mail: Round 6 of EmailUser refactoring
- Rename methods to follow the more standard convention used for
  commands.
- Update doc comments.
- Add new hooks with final method names and parameter types, to replace
  the old messy hooks.
- Deprecate the remaining old hooks.

Bug: T265541
Change-Id: I609709a70fb58ce00b9f179ee4de2f6ac5e0a1cf
2023-06-20 11:00:07 +00:00

40 lines
1.1 KiB
PHP

<?php
namespace MediaWiki\Mail\Hook;
use MailAddress;
use MediaWiki\Mail\UserEmailContact;
use MediaWiki\Permissions\Authority;
use StatusValue;
/**
* This is a hook handler interface, see docs/Hooks.md.
* Use the hook name "EmailUserSendEmail" to register handlers implementing this interface.
*
* @stable to implement
* @ingroup Hooks
* @since 1.41
*/
interface EmailUserSendEmailHook {
/**
* This hook is called before sending an email, when all other checks have succeeded.
*
* @param Authority $from
* @param MailAddress $fromAddress MailAddress of the sender
* @param UserEmailContact $to
* @param MailAddress $toAddress MailAddress of the target
* @param string $subject
* @param string $text
* @param StatusValue $status Add any error here
* @return bool|void True or no return value to continue. To abort, return false and add a fatal error to $status.
*/
public function onEmailUserSendEmail(
Authority $from,
MailAddress $fromAddress,
UserEmailContact $to,
MailAddress $toAddress,
string $subject,
string $text,
StatusValue $status
);
}