Index: trunk/extensions/MoodBar/include/MoodBarHTMLEmailNotification.php |
— | — | @@ -145,56 +145,48 @@ |
146 | 146 | $pageEditor = $wgEnotifUseRealName ? $this->editor->getRealName() : $this->editor->getName(); |
147 | 147 | } |
148 | 148 | |
149 | | - $feedbackUrl = SpecialPage::getTitleFor( 'FeedbackDashboard', $this->feedback )->getCanonicalURL(); |
150 | | - |
151 | 149 | // build the subject |
152 | 150 | $this->subject = wfMessage( 'moodbar-enotif-subject')->params( $pageEditor )->escaped(); |
153 | 151 | |
154 | | - // build the header |
155 | | - $textEmailHeader = wfMessage( 'moodbar-enotif-text-body-header' ) |
156 | | - ->params( $pageEditor, $feedbackUrl )->escaped(); |
157 | | - $htmlEmailHeader = wfMsgExt( 'moodbar-enotif-html-body-header', |
158 | | - array( 'parse' ), |
159 | | - $this->editor->getTalkPage()->getCanonicalURL(), |
160 | | - $pageEditor, |
161 | | - $feedbackUrl ); |
162 | | - // build the response text |
163 | | - $textResponse = htmlspecialchars( $this->response ); |
164 | | - $messageCache = MessageCache::singleton(); |
| 152 | + // build the body |
| 153 | + $messageCache = MessageCache::singleton(); |
| 154 | + $targetUserName = $this->targetUser->getName(); |
| 155 | + $FeedbackUrl = SpecialPage::getTitleFor( 'FeedbackDashboard', $this->feedback )->getPrefixedText(); |
| 156 | + $editorTalkPage = $this->editor->getTalkPage()->getPrefixedText(); |
| 157 | + $targetUserTalkPage = $this->targetUser->getTalkPage()->getCanonicalUrl(); |
| 158 | + //text version |
| 159 | + $textBody = wfMessage( 'moodbar-enotif-body')->params( $targetUserName, |
| 160 | + $FeedbackUrl, |
| 161 | + $editorTalkPage, |
| 162 | + $this->response, |
| 163 | + $targetUserTalkPage )->escaped(); |
| 164 | + $textBody = MessageCache::singleton()->transform( $textBody, false, null, $this->title ); |
165 | 165 | |
166 | | - // This is ugly, it's used to add domain name to wiki link so it can be clicked from email. |
| 166 | + //html version, this ugly as we have to make wiki link clickable in emails |
167 | 167 | $action = $wgRequest->getVal( 'action' ); |
168 | 168 | $wgRequest->setVal( 'action', 'render' ); |
169 | | - $htmlResponse = $messageCache->parse( $this->response )->getText(); |
170 | | - $wgRequest->setVal( 'action', $action ); |
171 | | - |
172 | | - //build the copy text |
173 | | - $textEmailCopy = wfMessage( 'moodbar-enotif-body-copy-text' )->escaped(); |
174 | | - $htmlEmailCopy = wfMsgExt( 'moodbar-enotif-body-copy-text', array( 'parse' ) ); |
175 | | - |
| 169 | + $htmlBody = wfMsgExt( 'moodbar-enotif-body', array( 'parse' ), $targetUserName, |
| 170 | + $FeedbackUrl, |
| 171 | + $editorTalkPage, |
| 172 | + '<div style="margin-left:20px;">' .$this->response . '</div>', |
| 173 | + $targetUserTalkPage ); |
| 174 | + $wgRequest->setVal( 'action', $action ); |
| 175 | + |
176 | 176 | //assemable the email body |
177 | 177 | $this->body = <<<HTML |
178 | 178 | --$this->mime_boundary |
179 | 179 | Content-Type: text/plain; charset=UTF-8 |
180 | 180 | Content-Transfer-Encoding: 8bit |
181 | 181 | |
182 | | -$textEmailHeader |
| 182 | +$textBody |
183 | 183 | |
184 | | -$textResponse |
185 | | - |
186 | | -$textEmailCopy |
187 | | - |
188 | 184 | --$this->mime_boundary |
189 | 185 | Content-Type: text/html; charset=UTF-8 |
190 | 186 | Content-Transfer-Encoding: 8bit |
191 | 187 | |
192 | 188 | <html> |
193 | 189 | <body> |
194 | | - $htmlEmailHeader |
195 | | - |
196 | | - $htmlResponse |
197 | | - |
198 | | - $htmlEmailCopy |
| 190 | + $htmlBody |
199 | 191 | </body> |
200 | 192 | </html> |
201 | 193 | |
Index: trunk/extensions/MoodBar/MoodBar.i18n.php |
— | — | @@ -163,13 +163,22 @@ |
164 | 164 | 'response-ajax-error-body' => 'There was an error adding your response. <br />Please try again later.', |
165 | 165 | //Email notification |
166 | 166 | 'moodbar-enotif-subject' => '$1 responded to your feedback', |
167 | | - 'moodbar-enotif-text-body-header' => '$1 responded to your feedback: $2', |
168 | | - 'moodbar-enotif-html-body-header' => '[$1 $2] responded to your [$3 feedback]', |
169 | | - 'moodbar-enotif-body-copy-text' => 'View this message on your talk page |
| 167 | + |
| 168 | + 'moodbar-enotif-body' => 'Hello $1! |
170 | 169 | |
171 | | -What is a talk page? |
| 170 | +Welcome to {{SITENAME}}, and thanks for your [[$2|feedback]]. Another Wikipedia user, [[$3|Responder]], wrote the following response: |
172 | 171 | |
173 | | -Your talk page is where other Wikipedia editors communicate with you by leaving messages. Wikipedia editors use talk pages to discuss issues, provide help, notify people of what’s happening in the community, express thanks. They also use talk pages just to say hi.', |
| 172 | +$4 |
| 173 | + |
| 174 | +View this message on your [$5 talk page] |
| 175 | + |
| 176 | +What’s a talk page? |
| 177 | +Your user talk page is the page that other {{SITENAME}} editors use to communicate with you. You can respond by clicking “Edit”, moving the cursor below the comment, typing your response and four tildes (~~~~) to sign, and saving. All pages in {{SITENAME}} have talk pages, and they’re used for many different purposes. It takes a while to get the hang of it, but is pretty easy once you’re used to it. |
| 178 | + |
| 179 | +Still confused? [http://en.wikipedia.org/wiki/File:Wikipedia_basics_-_Talk_pages.ogv This video] (watch on [http://www.youtube.com/watch?v=JdeDLRsB2Es YouTube]) gives you a step-by-step overview. |
| 180 | + |
| 181 | +Have a nice day, |
| 182 | +-- {{SITENAME}}', |
174 | 183 | ); |
175 | 184 | |
176 | 185 | /** Message documentation (Message documentation) |
— | — | @@ -307,9 +316,7 @@ |
308 | 317 | 'response-ajax-error-head' => 'Text for ajax status heading on error', |
309 | 318 | 'response-ajax-error-body' => 'Text for ajax status body on error (can be html)', |
310 | 319 | 'moodbar-enotif-subject' => 'Feedback response email subject', |
311 | | - 'moodbar-enotif-text-body-header' => 'The text version email header, $1 is the user name, $2 is the link to the feedback', |
312 | | - 'moodbar-enotif-html-body-header' => 'The html version email header, $1 is the the user talk page link, $2 is user name, $3 is the link to feedback', |
313 | | - 'moodbar-enotif-body-copy-text' => 'Email copy text', |
| 320 | + 'moodbar-enotif-body' => 'Feedback response email body, $1 is the commenter name, $2 is the link to the feedback of commenter, $3 is the responder talk page, $4 is the response text, $5 is commenter talk page', |
314 | 321 | ); |
315 | 322 | |
316 | 323 | /** Afrikaans (Afrikaans) |