Index: trunk/extensions/SemanticWatchlist/includes/SWL_Emailer.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | * @return Status |
28 | 28 | */ |
29 | 29 | public static function notifyUser( SWLGroup $group, User $user, SWLChangeSet $changeSet, $describeChanges ) { |
30 | | - global $wgLang; |
| 30 | + global $wgLang, $wgPasswordSender, $wgPasswordSenderName; |
31 | 31 | |
32 | 32 | $emailText = wfMsgExt( |
33 | 33 | 'swl-email-propschanged-long', |
— | — | @@ -58,37 +58,17 @@ |
59 | 59 | |
60 | 60 | wfRunHooks( 'SWLBeforeEmailNotify', array( $group, $user, $changeSet, $describeChanges, &$title, &$emailText ) ); |
61 | 61 | |
62 | | - return self::userSendMail( |
| 62 | + return UserMailer::send( |
| 63 | + new MailAddress( $user ), |
| 64 | + new MailAddress( $wgPasswordSender, $wgPasswordSenderName ), |
63 | 65 | $title, |
64 | | - $emailText |
| 66 | + $emailText, |
| 67 | + null, |
| 68 | + 'text/html; charset=ISO-8859-1' |
65 | 69 | ); |
66 | 70 | } |
67 | 71 | |
68 | 72 | /** |
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 | | - /** |
93 | 73 | * Creates and returns the HTML representatation of the change set. |
94 | 74 | * |
95 | 75 | * @since 0.1 |