r93777 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93776‎ | r93777 | r93778 >
Date:19:35, 2 August 2011
Author:mah
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -296,7 +296,10 @@
297297 $EditPage: the EditPage object
298298
299299 'AlternateUserMailer': Called before mail is sent so that mail could
300 -be logged (or something else) instead of using PEAR or SMTP
 300+be logged (or something else) instead of using PEAR or PHP's mail().
 301+Return false to skip the regular method of sending mail. Return a
 302+string to return a php-mail-error message containing the error.
 303+Returning true will continue with sending email in the regular way.
301304 $headers: Associative array of headers for the email
302305 $to: MailAddress object or array
303306 $from: From address
Index: trunk/phase3/includes/UserMailer.php
@@ -192,10 +192,10 @@
193193 $headers['X-Mailer'] = 'MediaWiki mailer';
194194 $headers['From'] = $from->toString();
195195
196 - $ret = wfRunHooks( 'AlternateUserMailer', array( $headers, $to, $from, $subject, $body, $replyto, $contentType ) );
 196+ $ret = wfRunHooks( 'AlternateUserMailer', array( $headers, $to, $from, $subject, $body ) );
197197 if ( $ret === false ) {
198198 return Status::newGood();
199 - } else if ( $ret != true ) {
 199+ } else if ( $ret !== true ) {
200200 return Status::newFatal( 'php-mail-error', $ret );
201201 }
202202

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93415Add hook that could be the solution for Bug #28026 (“Enable e-mail...mah19:19, 28 July 2011

Status & tagging log