Index: trunk/extensions/SemanticWatchlist/includes/SWL_Emailer.php |
— | — | @@ -58,13 +58,37 @@ |
59 | 59 | |
60 | 60 | wfRunHooks( 'SWLBeforeEmailNotify', array( $group, $user, $changeSet, $describeChanges, &$title, &$emailText ) ); |
61 | 61 | |
62 | | - return $user->sendMail( |
| 62 | + return $this->userSendMail( |
63 | 63 | $title, |
64 | 64 | $emailText |
65 | 65 | ); |
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
| 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=UTF-8' ); |
| 90 | + } |
| 91 | + |
| 92 | + /** |
69 | 93 | * Creates and returns the HTML representatation of the change set. |
70 | 94 | * |
71 | 95 | * @since 0.1 |