r93187 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93186‎ | r93187 | r93188 >
Date:14:57, 26 July 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
email fix
Modified paths:
  • /trunk/extensions/SemanticWatchlist/includes/SWL_Emailer.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticWatchlist/includes/SWL_Emailer.php
@@ -26,7 +26,7 @@
2727 * @return Status
2828 */
2929 public static function notifyUser( SWLGroup $group, User $user, SWLChangeSet $changeSet, $describeChanges ) {
30 - global $wgLang;
 30+ global $wgLang, $wgPasswordSender, $wgPasswordSenderName;
3131
3232 $emailText = wfMsgExt(
3333 'swl-email-propschanged-long',
@@ -58,37 +58,17 @@
5959
6060 wfRunHooks( 'SWLBeforeEmailNotify', array( $group, $user, $changeSet, $describeChanges, &$title, &$emailText ) );
6161
62 - return self::userSendMail(
 62+ return UserMailer::send(
 63+ new MailAddress( $user ),
 64+ new MailAddress( $wgPasswordSender, $wgPasswordSenderName ),
6365 $title,
64 - $emailText
 66+ $emailText,
 67+ null,
 68+ 'text/html; charset=ISO-8859-1'
6569 );
6670 }
6771
6872 /**
69 - * Based on User::sendMail, but specifies text/html as content type.
70 - *
71 - * @since 0.1
72 - *
73 - * @param string $subject
74 - * @param string $body
75 - * @param string|null $from
76 - * @param string|null $replyto
77 - *
78 - * @return Status
79 - */
80 - protected static function userSendMail( $subject, $body, $from = null, $replyto = null ) {
81 - if( is_null( $from ) ) {
82 - global $wgPasswordSender, $wgPasswordSenderName;
83 - $sender = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
84 - } else {
85 - $sender = new MailAddress( $from );
86 - }
87 -
88 - $to = new MailAddress( $this );
89 - return UserMailer::send( $to, $sender, $subject, $body, $replyto, 'text/html; charset=ISO-8859-1' );
90 - }
91 -
92 - /**
9373 * Creates and returns the HTML representatation of the change set.
9474 *
9575 * @since 0.1