From: umherirrender Date: Sat, 19 Sep 2015 18:50:37 +0000 (+0200) Subject: Update documentation for EmailUser hooks X-Git-Tag: 1.31.0-rc.0~9949^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=20318ecd87ae7cfb0a8454ec357812a4656ffba3;p=lhc%2Fweb%2Fwiklou.git Update documentation for EmailUser hooks Document the missing $error parameter of the EmailUser hook. Clarify the type of the address parameter Also add an comment, why a variable is used twice Follows 38c7c8f895f75ac04dbb6e0349779171f8a8e8a1 (r64903) Change-Id: I1c5636dc378667ef2798c69659b43f70734f4144 --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 54ab46c171..81bf861d4c 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1271,20 +1271,21 @@ $user: User being checked $confirmed: Whether or not the email address is confirmed 'EmailUser': Before sending email from one user to another. -$to: address of receiving user -$from: address of sending user +$to: MailAddress object of receiving user +$from: MailAddress object of sending user $subject: subject of the mail $text: text of the mail +&$error: Out-param for an error 'EmailUserCC': Before sending the copy of the email to the author. -$to: address of receiving user -$from: address of sending user +$to: MailAddress object of receiving user +$from: MailAddress object of sending user $subject: subject of the mail $text: text of the mail 'EmailUserComplete': After sending email from one user to another. -$to: address of receiving user -$from: address of sending user +$to: MailAddress object of receiving user +$from: MailAddress object of sending user $subject: subject of the mail $text: text of the mail diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index 1754471d5c..92cb8bf657 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -369,7 +369,10 @@ class SpecialEmailUser extends UnlistedSpecialPage { if ( $data['CCMe'] && $to != $from ) { $cc_subject = $context->msg( 'emailccsubject' )->rawParams( $target->getName(), $subject )->text(); + + // target and sender are equal, because this is the CC for the sender Hooks::run( 'EmailUserCC', array( &$from, &$from, &$cc_subject, &$text ) ); + $ccStatus = UserMailer::send( $from, $from, $cc_subject, $text ); $status->merge( $ccStatus ); }