r93127 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93126‎ | r93127 | r93128 >
Date:21:49, 25 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
@@ -58,13 +58,37 @@
5959
6060 wfRunHooks( 'SWLBeforeEmailNotify', array( $group, $user, $changeSet, $describeChanges, &$title, &$emailText ) );
6161
62 - return $user->sendMail(
 62+ return $this->userSendMail(
6363 $title,
6464 $emailText
6565 );
6666 }
6767
6868 /**
 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+ /**
6993 * Creates and returns the HTML representatation of the change set.
7094 *
7195 * @since 0.1

Follow-up revisions

RevisionCommit summaryAuthorDate
r93129fu r93127 - I'm an idiotjeroendedauw21:51, 25 July 2011
r93134fu r93127jeroendedauw22:03, 25 July 2011