From: Mark A. Hershberger Date: Tue, 2 Aug 2011 19:35:01 +0000 (+0000) Subject: re: r93415 X-Git-Tag: 1.31.0-rc.0~28479 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27votes%27%2C%20votes=%27waiting%27%29%20%7D%7D?a=commitdiff_plain;h=8e9deef3c42970c445a79264ead08c2e6ab17614;p=lhc%2Fweb%2Fwiklou.git re: r93415 * 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. --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 7e4eb0a1d7..6b8bf40815 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -296,7 +296,10 @@ on &action=edit. $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 diff --git a/includes/UserMailer.php b/includes/UserMailer.php index b3951aec16..164b8ba4bd 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -192,10 +192,10 @@ class UserMailer { $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(); - } else if ( $ret != true ) { + } else if ( $ret !== true ) { return Status::newFatal( 'php-mail-error', $ret ); }