Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -98,9 +98,10 @@ |
99 | 99 | * @param $subject String: email's subject. |
100 | 100 | * @param $body String: email's text. |
101 | 101 | * @param $replyto String: optional reply-to email (default: null). |
| 102 | + * @param $contentType String: optional custom Content-Type |
102 | 103 | * @return mixed True on success, a WikiError object on failure. |
103 | 104 | */ |
104 | | - static function send( $to, $from, $subject, $body, $replyto=null ) { |
| 105 | + static function send( $to, $from, $subject, $body, $replyto=null, $contentType=null ) { |
105 | 106 | global $wgSMTP, $wgOutputEncoding, $wgErrorString, $wgEnotifImpersonal; |
106 | 107 | global $wgEnotifMaxRecips; |
107 | 108 | |
— | — | @@ -139,7 +140,12 @@ |
140 | 141 | $headers['Subject'] = wfQuotedPrintable( $subject ); |
141 | 142 | $headers['Date'] = date( 'r' ); |
142 | 143 | $headers['MIME-Version'] = '1.0'; |
143 | | - $headers['Content-type'] = 'text/plain; charset='.$wgOutputEncoding; |
| 144 | + $headers['Content-type'] = (is_null($contentType) ? |
| 145 | + 'text/plain; charset='.$wgOutputEncoding : $contentType); |
| 146 | + if(is_null($contentType)) |
| 147 | + $headers['Content-type'] = 'text/plain; charset='.$wgOutputEncoding; |
| 148 | + else |
| 149 | + $headers['Content-type'] = $contentType; |
144 | 150 | $headers['Content-transfer-encoding'] = '8bit'; |
145 | 151 | $headers['Message-ID'] = "<$msgid@" . $wgSMTP['IDHost'] . '>'; // FIXME |
146 | 152 | $headers['X-Mailer'] = 'MediaWiki mailer'; |
— | — | @@ -170,9 +176,11 @@ |
171 | 177 | } else { |
172 | 178 | $endl = "\n"; |
173 | 179 | } |
| 180 | + $ctype = (is_null($contentType) ? |
| 181 | + 'text/plain; charset='.$wgOutputEncoding : $contentType); |
174 | 182 | $headers = |
175 | 183 | "MIME-Version: 1.0$endl" . |
176 | | - "Content-type: text/plain; charset={$wgOutputEncoding}$endl" . |
| 184 | + "Content-type: $ctype$endl" . |
177 | 185 | "Content-Transfer-Encoding: 8bit$endl" . |
178 | 186 | "X-Mailer: MediaWiki mailer$endl". |
179 | 187 | 'From: ' . $from->toString(); |