Index: trunk/extensions/MoodBar/include/MoodBarHTMLMailerJob.php |
— | — | @@ -20,12 +20,10 @@ |
21 | 21 | $editor, |
22 | 22 | $this->title, |
23 | 23 | $this->params['timestamp'], |
24 | | - $this->params['feedbackResponse'], |
| 24 | + $this->params['feedback'], |
25 | 25 | $this->params['response'] |
26 | 26 | ); |
27 | 27 | return true; |
28 | 28 | } |
29 | 29 | |
30 | 30 | } |
31 | | - |
32 | | -?> |
Index: trunk/extensions/MoodBar/include/MoodBarHTMLEmailNotification.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | class MoodBarHTMLEmailNotification { |
9 | 9 | |
10 | 10 | protected $to, $subject, $body, $replyto, $from; |
11 | | - protected $timestamp, $composed_common, $feedbackResponse, $response; |
| 11 | + protected $timestamp, $composed_common, $response, $feedback; |
12 | 12 | protected $mime_boundary; |
13 | 13 | |
14 | 14 | /** |
— | — | @@ -34,10 +34,10 @@ |
35 | 35 | * @param $editor User object |
36 | 36 | * @param $title Title object |
37 | 37 | * @param $timestamp string Edit timestamp |
38 | | - * @param $feedbackResponse integer response id |
39 | 38 | * @param $response string response text |
| 39 | + * @param $feedback integer feedback id |
40 | 40 | */ |
41 | | - public function notifyOnRespond( $editor, $title, $timestamp, $feedbackResponse, $response ) { |
| 41 | + public function notifyOnRespond( $editor, $title, $timestamp, $feedback, $response ) { |
42 | 42 | global $wgEnotifUseJobQ, $wgEnotifUserTalk; |
43 | 43 | |
44 | 44 | if ( $title->getNamespace() != NS_USER_TALK || !$wgEnotifUserTalk || |
— | — | @@ -51,12 +51,12 @@ |
52 | 52 | 'editorID' => $editor->getID(), |
53 | 53 | 'timestamp' => $timestamp, |
54 | 54 | 'response' => $response, |
55 | | - 'feedbackResponse' => $feedbackResponse |
| 55 | + 'feedback' => $feedback |
56 | 56 | ); |
57 | 57 | $job = new MoodBarHTMLMailerJob( $title, $params ); |
58 | 58 | $job->insert(); |
59 | 59 | } else { |
60 | | - $this->actuallyNotifyOnRespond( $editor, $title, $timestamp, $feedbackResponse, $response ); |
| 60 | + $this->actuallyNotifyOnRespond( $editor, $title, $timestamp, $feedback, $response ); |
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
— | — | @@ -69,10 +69,10 @@ |
70 | 70 | * @param $editor User object |
71 | 71 | * @param $title Title object |
72 | 72 | * @param $timestamp string Edit timestamp |
73 | | - * @param $feedbackResponse integer response id |
74 | 73 | * @param $response string response text |
| 74 | + * @param $feedabck integer feedback id |
75 | 75 | */ |
76 | | - public function actuallyNotifyOnRespond( $editor, $title, $timestamp, $feedbackResponse, $response ) { |
| 76 | + public function actuallyNotifyOnRespond( $editor, $title, $timestamp, $feedback, $response ) { |
77 | 77 | |
78 | 78 | global $wgEnotifUserTalk; |
79 | 79 | |
— | — | @@ -86,8 +86,8 @@ |
87 | 87 | $this->timestamp = $timestamp; |
88 | 88 | $this->editor = $editor; |
89 | 89 | $this->composed_common = false; |
90 | | - $this->feedbackResponse = $feedbackResponse; |
91 | 90 | $this->response = $response; |
| 91 | + $this->feedback = $feedback; |
92 | 92 | |
93 | 93 | if ( $wgEnotifUserTalk && $this->canSendUserTalkEmail( $editor, $title ) ) { |
94 | 94 | $this->compose( $this->targetUser ); |
— | — | @@ -145,48 +145,51 @@ |
146 | 146 | $pageEditor = $wgEnotifUseRealName ? $this->editor->getRealName() : $this->editor->getName(); |
147 | 147 | } |
148 | 148 | |
149 | | - $talkPageUrl = $this->title->getCanonicalURL() . '#feedback-dashboard-response-' . $this->feedbackResponse; |
| 149 | + $feedbackUrl = SpecialPage::getTitleFor( 'FeedbackDashboard', $this->feedback )->getCanonicalURL(); |
150 | 150 | |
151 | 151 | // build the subject |
152 | | - $this->subject = wfMessage( 'moodbar-enotif-subject')->params($pageEditor)->escaped(); |
| 152 | + $this->subject = wfMessage( 'moodbar-enotif-subject')->params( $pageEditor )->escaped(); |
153 | 153 | |
154 | | - // build section for the email body |
155 | | - $textUserResponseMessage = wfMessage('moodbar-enotif-text-body-user-response-message') |
156 | | - ->params($this->editor->getName(), $talkPageUrl)->escaped(); |
157 | | - |
158 | | - $htmlUserResponseMessage = wfMsgExt('moodbar-enotif-html-body-user-response-message', |
159 | | - array('parse'), |
160 | | - $this->editor->getUserPage()->getCanonicalURL(), |
161 | | - $this->editor->getName(), |
162 | | - $talkPageUrl); |
163 | | - |
164 | | - $userReplyTitle = wfMessage('moodbar-enotif-body-user-response-title')->escaped(); |
165 | | - |
166 | | - |
| 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 |
167 | 163 | $textResponse = htmlspecialchars( $this->response ); |
168 | | - |
169 | 164 | $messageCache = MessageCache::singleton(); |
170 | 165 | $htmlResponse = $messageCache->parse( $this->response )->getText(); |
171 | 166 | |
| 167 | + //build the copy text |
| 168 | + $textEmailCopy = wfMessage( 'moodbar-enotif-body-copy-text' )->escaped(); |
| 169 | + $htmlEmailCopy = wfMsgExt( 'moodbar-enotif-body-copy-text', array( 'parse' ) ); |
| 170 | + |
172 | 171 | //assemable the email body |
173 | 172 | $this->body = <<<HTML |
174 | 173 | --$this->mime_boundary |
175 | 174 | Content-Type: text/plain; charset=UTF-8 |
176 | 175 | Content-Transfer-Encoding: 8bit |
177 | 176 | |
178 | | -$textUserResponseMessage |
179 | | -$userReplyTitle |
| 177 | +$textEmailHeader |
| 178 | + |
180 | 179 | $textResponse |
181 | 180 | |
| 181 | +$textEmailCopy |
| 182 | + |
182 | 183 | --$this->mime_boundary |
183 | 184 | Content-Type: text/html; charset=UTF-8 |
184 | 185 | Content-Transfer-Encoding: 8bit |
185 | 186 | |
186 | 187 | <html> |
187 | 188 | <body> |
188 | | - $htmlUserResponseMessage |
189 | | - $userReplyTitle |
| 189 | + $htmlEmailHeader |
| 190 | + |
190 | 191 | $htmlResponse |
| 192 | + |
| 193 | + $htmlEmailCopy |
191 | 194 | </body> |
192 | 195 | </html> |
193 | 196 | |
— | — | @@ -234,5 +237,3 @@ |
235 | 238 | } |
236 | 239 | |
237 | 240 | } |
238 | | - |
239 | | -?> |
Index: trunk/extensions/MoodBar/MoodBar.i18n.php |
— | — | @@ -161,9 +161,13 @@ |
162 | 162 | 'response-ajax-error-body' => 'There was an error adding your response. <br />Please try again later.', |
163 | 163 | //Email notification |
164 | 164 | 'moodbar-enotif-subject' => '$1 replied to your feedback', |
165 | | - 'moodbar-enotif-text-body-user-response-message' => '$1 replied to your feedback, see the response: $2', |
166 | | - 'moodbar-enotif-html-body-user-response-message' => '[$1 $2] replied to your feedback, see the [$3 response] for more detail', |
167 | | - 'moodbar-enotif-body-user-response-title' => 'User response:' |
| 165 | + 'moodbar-enotif-text-body-header' => '$1 responded to your feedback: $2', |
| 166 | + 'moodbar-enotif-html-body-header' => '[$1 $2] responded to your [$3 feedback]', |
| 167 | + 'moodbar-enotif-body-copy-text' => 'View this message on your talk page |
| 168 | + |
| 169 | +What is a talk page? |
| 170 | + |
| 171 | +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.' |
168 | 172 | ); |
169 | 173 | |
170 | 174 | /** Message documentation (Message documentation) |
— | — | @@ -298,8 +302,9 @@ |
299 | 303 | 'response-ajax-error-head' => 'Text for ajax status heading on error', |
300 | 304 | 'response-ajax-error-body' => 'Text for ajax status body on error (can be html)', |
301 | 305 | 'moodbar-enotif-subject' => 'Feedback response email subject', |
302 | | - 'moodbar-enotif-text-body-user-response-message' => 'The text version response message, $1 is the user name, $2 is the link to the response', |
303 | | - 'moodbar-enotif-html-body-user-response-message' => 'The html version response message, $1 is the the user page link, $2 is user name, $3 is the link to response', |
| 306 | + 'moodbar-enotif-text-body-header' => 'The text version email header, $1 is the user name, $2 is the link to the feedback', |
| 307 | + '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', |
| 308 | + 'moodbar-enotif-body-copy-text' => 'Email copy text' |
304 | 309 | ); |
305 | 310 | |
306 | 311 | /** Afrikaans (Afrikaans) |
Index: trunk/extensions/MoodBar/ApiFeedbackDashboardResponse.php |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | global $wgLang; |
67 | 67 | |
68 | 68 | $EMailNotif = new MoodBarHTMLEmailNotification(); |
69 | | - $EMailNotif->notifyOnRespond( $wgUser, $talkPage, wfTimestampNow(), $item->getProperty( 'id' ), $wgLang->truncate( $response, 250 ) ); |
| 69 | + $EMailNotif->notifyOnRespond( $wgUser, $talkPage, wfTimestampNow(), $item->getProperty('feedback'), $wgLang->truncate( $response, 250 ) ); |
70 | 70 | |
71 | 71 | } |
72 | 72 | |
— | — | @@ -160,5 +160,3 @@ |
161 | 161 | } |
162 | 162 | |
163 | 163 | } |
164 | | - |
165 | | -?> |