* Document what happens as the result of each value returned
* Require boolean true to continue, not just a true value or strings
would succeed
* Trim the arguments since the header array already contains them.
$EditPage: the EditPage object
'AlternateUserMailer': Called before mail is sent so that mail could
$EditPage: the EditPage object
'AlternateUserMailer': Called before mail is sent so that mail could
-be logged (or something else) instead of using PEAR or SMTP
+be logged (or something else) instead of using PEAR or PHP's mail().
+Return false to skip the regular method of sending mail. Return a
+string to return a php-mail-error message containing the error.
+Returning true will continue with sending email in the regular way.
$headers: Associative array of headers for the email
$to: MailAddress object or array
$from: From address
$headers: Associative array of headers for the email
$to: MailAddress object or array
$from: From address
$headers['X-Mailer'] = 'MediaWiki mailer';
$headers['From'] = $from->toString();
$headers['X-Mailer'] = 'MediaWiki mailer';
$headers['From'] = $from->toString();
- $ret = wfRunHooks( 'AlternateUserMailer', array( $headers, $to, $from, $subject, $body, $replyto, $contentType ) );
+ $ret = wfRunHooks( 'AlternateUserMailer', array( $headers, $to, $from, $subject, $body ) );
if ( $ret === false ) {
return Status::newGood();
if ( $ret === false ) {
return Status::newGood();
- } else if ( $ret != true ) {
+ } else if ( $ret !== true ) {
return Status::newFatal( 'php-mail-error', $ret );
}
return Status::newFatal( 'php-mail-error', $ret );
}