Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -295,6 +295,15 @@ |
296 | 296 | on &action=edit. |
297 | 297 | $EditPage: the EditPage object |
298 | 298 | |
| 299 | +'AlternateUserMailer': Called before mail is sent so that mail could |
| 300 | +be logged (or something else) instead of using PEAR or SMTP |
| 301 | +$UserMailer: the EditPage object |
| 302 | +$headers: Associative array of headers for the email |
| 303 | +$to: MailAddress object or array |
| 304 | +$from: From address |
| 305 | +$subject: Subject of the email |
| 306 | +$body: Body of the message |
| 307 | + |
299 | 308 | 'APIAfterExecute': after calling the execute() method of an API module. |
300 | 309 | Use this to extend core API modules. |
301 | 310 | &$module: Module object |
Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -180,6 +180,13 @@ |
181 | 181 | $headers['X-Mailer'] = 'MediaWiki mailer'; |
182 | 182 | $headers['From'] = $from->toString(); |
183 | 183 | |
| 184 | + $ret = wfRunHooks( 'AlternateUserMailer', array( $this, $headers, $to, $from, $subject, $body, $replyto, $contentType ) ) ) { |
| 185 | + if ( $ret === false ) { |
| 186 | + return Status::newGood(); |
| 187 | + } else if ( $ret != true ) { |
| 188 | + return Status::newFatal( 'php-mail-error', $ret ); |
| 189 | + } |
| 190 | + |
184 | 191 | if ( is_array( $wgSMTP ) ) { |
185 | 192 | if ( function_exists( 'stream_resolve_include_path' ) ) { |
186 | 193 | $found = stream_resolve_include_path( 'Mail.php' ); |