Indefero

Indefero Commit Details


Date:2011-11-05 08:15:43 (13 years 1 month ago)
Author:Thomas Keller
Branch:develop, release-1.3
Commit:82a2d6a39cb6694147949856d670793df0e873c2
Parents: 2b5efb7fee5e0702d461ec5761abb5a4e2a856a9
Message:Rework the notification functionality in all areas:

- for object changes in each tab / section we send out notifications to
project owners, members and / or additional addresses (all this is
configurable) (fixes issues 334, 452, 480 and possible others)
- one can now also receive notifications about download updates
- the notification template that informs about issue updates is no
longer confusing the reader with the "a new issue has been created
and assigned to you" phrase if the user who is notified is not
actually the (new) owner (fixes issue 562)
- send-out notification emails for reviews, wiki updates and review
updates are now linked via a unique message id to support a threaded
view in email clients like Thunderbird (this was previously only
implemented for issue notifications for issue 414)

This commit has been sponsored by SciLab.
Changes:

File differences

src/IDF/Commit.php
312312
313313
314314
315
316
317
318
319315
320
321
322316
323
324
325
326
327
328
329
330
331
332
333
334
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
335343
336
344
337345
338
346
339347
340348
341349
350
342351
343352
344353
$item->payload = $payload;
$item->create();
if ('' == $conf->getVal('source_notification_email', '')) {
return;
}
$current_locale = Pluf_Translation::getLocale();
$langs = Pluf::f('languages', array('en'));
Pluf_Translation::loadSetLocale($langs[0]);
$context = new Pluf_Template_Context(
array(
'c' => $this,
'project' => $this->get_project(),
'url_base' => Pluf::f('url_base'),
)
);
$tmpl = new Pluf_Template('idf/source/commit-created-email.txt');
$text_email = $tmpl->render($context);
$addresses = explode(',', $conf->getVal('source_notification_email'));
foreach ($addresses as $address) {
$email = new Pluf_Mail(Pluf::f('from_email'),
$from_email = Pluf::f('from_email');
$recipients = $project->getNotificationRecipientsForTab('source');
foreach ($recipients as $address => $language) {
if (!empty($this->author) && $this->author->email === $address) {
continue;
}
Pluf_Translation::loadSetLocale($language);
$context = new Pluf_Template_Context(array(
'commit' => $this,
'project' => $project,
'url_base' => Pluf::f('url_base'),
));
// commits are usually not updated, therefor we do not
// distinguish between create and update here
$tplfile = 'idf/source/commit-created-email.txt';
$subject = __('New commit %s - %s (%s)');
$tmpl = new Pluf_Template($tplfile);
$text_email = $tmpl->render($context);
$email = new Pluf_Mail($from_email,
$address,
sprintf(__('New Commit %s - %s (%s)'),
sprintf($subject,
$this->scm_id, $this->summary,
$this->get_project()->shortname));
$project->shortname));
$email->addTextMessage($text_email);
$email->sendMail();
}
Pluf_Translation::loadSetLocale($current_locale);
}
}
src/IDF/Issue.php
256256
257257
258258
259
260
261
262
263
264
265
266
267
259
268260
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
321292
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
342313
314
315
316
317
318
319
320
321
322
343323
324
344325
345326
346327
*/
public function notify($conf, $create=true)
{
$prj = $this->get_project();
$to_email = array();
if ('' != $conf->getVal('issues_notification_email', '')) {
$langs = Pluf::f('languages', array('en'));
$addresses = explode(',', $conf->getVal('issues_notification_email'));
foreach ($addresses as $address) {
$to_email[] = array($address, $langs[0]);
}
}
$project = $this->get_project();
$current_locale = Pluf_Translation::getLocale();
$id = '<'.md5($this->id.md5(Pluf::f('secret_key'))).'@'.Pluf::f('mail_host', 'localhost').'>';
if ($create) {
if (null != $this->get_owner() and $this->owner != $this->submitter) {
$email_lang = array($this->get_owner()->email,
$this->get_owner()->language);
if (!in_array($email_lang, $to_email)) {
$to_email[] = $email_lang;
}
}
$comments = $this->get_comments_list(array('order' => 'id ASC'));
$context = new Pluf_Template_Context(
array(
'issue' => $this,
'comment' => $comments[0],
'project' => $prj,
'url_base' => Pluf::f('url_base'),
)
);
foreach ($to_email as $email_lang) {
Pluf_Translation::loadSetLocale($email_lang[1]);
$email = new Pluf_Mail(Pluf::f('from_email'), $email_lang[0],
sprintf(__('Issue %s - %s (%s)'),
$this->id, $this->summary, $prj->shortname));
$tmpl = new Pluf_Template('idf/issues/issue-created-email.txt');
$email->addTextMessage($tmpl->render($context));
$email->addHeaders(array('Message-ID'=>$id));
$email->sendMail();
}
} else {
$comments = $this->get_comments_list(array('order' => 'id DESC'));
$email_sender = '';
if (isset($comments[0])) {
$email_sender = $comments[0]->get_submitter()->email;
}
foreach ($this->get_interested_list() as $interested) {
$email_lang = array($interested->email,
$interested->language);
if (!in_array($email_lang, $to_email)) {
$to_email[] = $email_lang;
}
}
$email_lang = array($this->get_submitter()->email,
$this->get_submitter()->language);
if (!in_array($email_lang, $to_email)) {
$to_email[] = $email_lang;
}
if (null != $this->get_owner()) {
$email_lang = array($this->get_owner()->email,
$this->get_owner()->language);
if (!in_array($email_lang, $to_email)) {
$to_email[] = $email_lang;
}
$from_email = Pluf::f('from_email');
$comments = $this->get_comments_list(array('order' => 'id DESC'));
$messageId = '<'.md5('issue'.$this->id.md5(Pluf::f('secret_key'))).'@'.Pluf::f('mail_host', 'localhost').'>';
$recipients = $project->getNotificationRecipientsForTab('issues');
// the submitter (might be skipped later on if he is the one who also
// submitted the last comment)
if (!array_key_exists($this->get_submitter()->email, $recipients)) {
$recipients[$this->get_submitter()->email] = $this->get_submitter()->language;
}
// the owner of the issue, if we have one
$owner = $this->get_owner();
if (null != $owner && !array_key_exists($owner->email, $recipients)) {
$recipients[$owner->email] = $owner->language;
}
// additional users who starred the issue
foreach ($this->get_interested_list() as $interested) {
if (array_key_exists($interested->email, $recipients))
continue;
$recipients[$interested->email] = $interested->language;
}
foreach ($recipients as $address => $language) {
// do not notify the creator of the last comment,
// i.e. the user who triggered this notification
if ($comments[0]->get_submitter()->email === $address) {
continue;
}
$context = new Pluf_Template_Context(
array(
'issue' => $this,
'comments' => $comments,
'project' => $prj,
'url_base' => Pluf::f('url_base'),
));
foreach ($to_email as $email_lang) {
if ($email_lang[0] == $email_sender) {
continue; // Do not notify the one having created
// the comment
}
Pluf_Translation::loadSetLocale($email_lang[1]);
$email = new Pluf_Mail(Pluf::f('from_email'), $email_lang[0],
sprintf(__('Updated Issue %s - %s (%s)'),
$this->id, $this->summary, $prj->shortname));
$tmpl = new Pluf_Template('idf/issues/issue-updated-email.txt');
$email->addTextMessage($tmpl->render($context));
$email->addHeaders(array('References'=>$id));
$email->sendMail();
Pluf_Translation::loadSetLocale($language);
$context = new Pluf_Template_Context(array(
'issue' => $this,
'owns_issue' => $owner !== null && $owner->email === $address,
// the initial comment for create, the last for update
'comment' => $comments[0],
'comments' => $comments,
'project' => $project,
'url_base' => Pluf::f('url_base'),
));
$tplfile = 'idf/issues/issue-created-email.txt';
$subject = __('Issue %s - %s (%s)');
$headers = array('Message-ID' => $messageId);
if (!$create) {
$tplfile = 'idf/issues/issue-updated-email.txt';
$subject = __('Updated Issue %s - %s (%s)');
$headers = array('References' => $messageId);
}
$tmpl = new Pluf_Template($tplfile);
$text_email = $tmpl->render($context);
$email = new Pluf_Mail($from_email, $address,
sprintf($subject, $this->id, $this->summary, $project->shortname));
$email->addTextMessage($text_email);
$email->addHeaders($headers);
$email->sendMail();
}
Pluf_Translation::loadSetLocale($current_locale);
}
}
src/IDF/Project.php
796796
797797
798798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
799847
$this->_isRestricted = false;
return false;
}
/**
* Returns an associative array of email addresses to notify about changes
* in a certain tab like 'issues', 'source', and so on.
*
* @param string $tab
* @return array Key is the email address, value is the preferred language setting
*/
public function getNotificationRecipientsForTab($tab)
{
if (!in_array($tab, array('source', 'issues', 'downloads', 'wiki', 'review'))) {
throw new Exception(sprintf('unknown tab %s', $tab));
}
$conf = $this->getConf();
$recipients = array();
$membership_data = $this->getMembershipData();
if ($conf->getVal($tab.'_notification_owners_enabled', false)) {
foreach ($membership_data['owners'] as $owner) {
$recipients[$owner->email] = $owner->language;
}
}
if ($conf->getVal($tab.'_notification_members_enabled', false)) {
foreach ($membership_data['members'] as $member) {
$recipients[$member->email] = $member->language;
}
}
if ($conf->getVal($tab.'_notification_email_enabled', false)) {
$addresses = preg_split('/\s*,\s*/',
$conf->getVal($tab.'_notification_email', ''),
-1, PREG_SPLIT_NO_EMPTY);
// we use a default language setting for this plain list of
// addresses, but we ensure that we do not overwrite an existing
// address which might come with a proper setting already
$languages = Pluf::f('languages', array('en'));
foreach ($addresses as $address) {
if (array_key_exists($address, $recipients))
continue;
$recipients[$address] = $languages[0];
}
}
return $recipients;
}
}
src/IDF/Review/Comment.php
175175
176176
177177
178
179
180
181
182
183
184
185
186
187
188
178
179
180
181
182
189183
190184
191185
186
192187
193188
194
195
196
197
198
199
200
201
202
203
204
189
190
191
205192
206
207
208
209
210
193
194
195
211196
212
213
214
215
216
217
218
219
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
220232
221233
234
222235
223236
224237
*/
public function notify($conf, $create=true)
{
$patch = $this->get_patch();
$review = $patch->get_review();
$prj = $review->get_project();
$to_email = array();
if ('' != $conf->getVal('review_notification_email', '')) {
$langs = Pluf::f('languages', array('en'));
$to_email[] = array($conf->getVal('issues_notification_email'),
$langs[0]);
}
$current_locale = Pluf_Translation::getLocale();
$reviewers = $review->getReviewers();
$patch = $this->get_patch();
$review = $patch->get_review();
$prj = $review->get_project();
$reviewers = $review->getReviewers();
if (!Pluf_Model_InArray($review->get_submitter(), $reviewers)) {
$reviewers[] = $review->get_submitter();
}
$comments = $patch->getFileComments(array('order' => 'id DESC'));
$gcomments = $patch->get_comments_list(array('order' => 'id DESC'));
$context = new Pluf_Template_Context(
array(
'review' => $review,
'patch' => $patch,
'comments' => $comments,
'gcomments' => $gcomments,
'project' => $prj,
'url_base' => Pluf::f('url_base'),
)
);
// build the list of emails and lang
$recipients = $prj->getNotificationRecipientsForTab('review');
foreach ($reviewers as $user) {
$email_lang = array($user->email,
$user->language);
if (!in_array($email_lang, $to_email)) {
$to_email[] = $email_lang;
}
if (array_key_exists($user->email, $recipients))
continue;
$recipients[$user->email] = $user->language;
}
$tmpl = new Pluf_Template('idf/review/review-updated-email.txt');
foreach ($to_email as $email_lang) {
Pluf_Translation::loadSetLocale($email_lang[1]);
$email = new Pluf_Mail(Pluf::f('from_email'), $email_lang[0],
sprintf(__('Updated Code Review %s - %s (%s)'),
$review->id, $review->summary, $prj->shortname));
$email->addTextMessage($tmpl->render($context));
$current_locale = Pluf_Translation::getLocale();
$from_email = Pluf::f('from_email');
$messageId = '<'.md5('review'.$review->id.md5(Pluf::f('secret_key'))).'@'.Pluf::f('mail_host', 'localhost').'>';
foreach ($recipients as $address => $language) {
if ($this->get_submitter()->email === $address) {
continue;
}
Pluf_Translation::loadSetLocale($language);
$context = new Pluf_Template_Context(array(
'review' => $review,
'patch' => $patch,
'comments' => $comments,
'gcomments' => $gcomments,
'project' => $prj,
'url_base' => Pluf::f('url_base'),
));
// reviews only updated through comments, see IDF_Review_Patch::notify()
$tplfile = 'idf/review/review-updated-email.txt';
$subject = __('Updated Code Review %s - %s (%s)');
$headers = array('References' => $messageId);
$tmpl = new Pluf_Template($tplfile);
$text_email = $tmpl->render($context);
$email = new Pluf_Mail($from_email, $address,
sprintf($subject, $review->id, $review->summary, $prj->shortname));
$email->addTextMessage($text_email);
$email->addHeaders($headers);
$email->sendMail();
}
Pluf_Translation::loadSetLocale($current_locale);
}
src/IDF/Review/Patch.php
4242
4343
4444
45
45
4646
47
47
4848
4949
5050
......
5959
6060
6161
62
62
6363
6464
6565
......
129129
130130
131131
132
133
132
133
134134
135135
136136
......
139139
140140
141141
142
142
143143
144144
145145
......
150150
151151
152152
153
153
154154
155155
156156
157157
158158
159159
160
160
161161
162162
163163
......
179179
180180
181181
182
183
184
182
183
185184
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
203215
204
205
206
207
216
217
218
219
208220
221
209222
210223
224
211225
212226
213227
'id' =>
array(
'type' => 'Pluf_DB_Field_Sequence',
'blank' => true,
'blank' => true,
),
'review' =>
'review' =>
array(
'type' => 'Pluf_DB_Field_Foreignkey',
'model' => 'IDF_Review',
'size' => 250,
'verbose' => __('summary'),
),
'commit' =>
'commit' =>
array(
'type' => 'Pluf_DB_Field_Foreignkey',
'model' => 'IDF_Commit',
function postSave($create=false)
{
if ($create) {
IDF_Timeline::insert($this,
$this->get_review()->get_project(),
IDF_Timeline::insert($this,
$this->get_review()->get_project(),
$this->get_review()->get_submitter());
IDF_Search::index($this->get_review());
}
public function timelineFragment($request)
{
$review = $this->get_review();
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
array($request->project->shortname,
$review->id));
$out = '<tr class="log"><td><a href="'.$url.'">'.
$ic = (in_array($review->status, $request->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o';
$out .= sprintf(__('<a href="%1$s" class="%2$s" title="View review">Review %3$d</a>, %4$s'), $url, $ic, $review->id, Pluf_esc($review->summary)).'</td>';
$out .= "\n".'<tr class="extra"><td colspan="2">
<div class="helptext right">'.sprintf(__('Creation of <a href="%s" class="%s">review&nbsp;%d</a>, by %s'), $url, $ic, $review->id, $user).'</div></td></tr>';
<div class="helptext right">'.sprintf(__('Creation of <a href="%s" class="%s">review&nbsp;%d</a>, by %s'), $url, $ic, $review->id, $user).'</div></td></tr>';
return Pluf_Template::markSafe($out);
}
public function feedFragment($request)
{
$review = $this->get_review();
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
array($request->project->shortname,
$review->id));
$title = sprintf(__('%s: Creation of Review %d - %s'),
public function notify($conf, $create=true)
{
if ('' == $conf->getVal('review_notification_email', '')) {
return;
}
$review = $this->get_review();
$project = $review->get_project();
$current_locale = Pluf_Translation::getLocale();
$langs = Pluf::f('languages', array('en'));
Pluf_Translation::loadSetLocale($langs[0]);
$context = new Pluf_Template_Context(
array(
'review' => $this->get_review(),
'patch' => $this,
'comments' => array(),
'project' => $this->get_review()->get_project(),
'url_base' => Pluf::f('url_base'),
)
);
$tmpl = new Pluf_Template('idf/review/review-created-email.txt');
$text_email = $tmpl->render($context);
$addresses = explode(';',$conf->getVal('review_notification_email'));
foreach ($addresses as $address) {
$email = new Pluf_Mail(Pluf::f('from_email'),
$from_email = Pluf::f('from_email');
$messageId = '<'.md5('review'.$review->id.md5(Pluf::f('secret_key'))).'@'.Pluf::f('mail_host', 'localhost').'>';
$recipients = $project->getNotificationRecipientsForTab('review');
foreach ($recipients as $address => $language) {
if ($review->get_submitter()->email === $address) {
continue;
}
Pluf_Translation::loadSetLocale($language);
$context = new Pluf_Template_Context(array(
'review' => $review,
'patch' => $this,
'comments' => array(),
'project' => $project,
'url_base' => Pluf::f('url_base'),
));
// reviews are updated through comments, see IDF_Review_Comment::notify()
$tplfile = 'idf/review/review-created-email.txt';
$subject = __('New Code Review %s - %s (%s)');
$headers = array('Message-ID' => $messageId);
$tmpl = new Pluf_Template($tplfile);
$text_email = $tmpl->render($context);
$email = new Pluf_Mail($from_email,
$address,
sprintf(__('New Code Review %s - %s (%s)'),
$this->get_review()->id,
$this->get_review()->summary,
$this->get_review()->get_project()->shortname));
sprintf($subject,
$review->id,
$review->summary,
$project->shortname));
$email->addTextMessage($text_email);
$email->addHeaders($headers);
$email->sendMail();
}
Pluf_Translation::loadSetLocale($current_locale);
}
}
src/IDF/Upload.php
273273
274274
275275
276
277
278
279276
280
281
282277
283
284
285
286
287
288
289
290
291
292
293
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
294310
295
311
296312
297
313
298314
315
299316
300317
318
301319
302320
303321
$item->payload = $payload;
$item->create();
if ('' == $conf->getVal('downloads_notification_email', '')) {
return;
}
$current_locale = Pluf_Translation::getLocale();
$langs = Pluf::f('languages', array('en'));
Pluf_Translation::loadSetLocale($langs[0]);
$context = new Pluf_Template_Context(
array('file' => $this,
'urlfile' => $this->getAbsoluteUrl($this->get_project()),
'project' => $this->get_project(),
'tags' => $this->get_tags_list(),
));
$tmpl = new Pluf_Template('idf/downloads/download-created-email.txt');
$text_email = $tmpl->render($context);
$addresses = explode(',', $conf->getVal('downloads_notification_email'));
foreach ($addresses as $address) {
$email = new Pluf_Mail(Pluf::f('from_email'),
$from_email = Pluf::f('from_email');
$messageId = '<'.md5('upload'.$this->id.md5(Pluf::f('secret_key'))).'@'.Pluf::f('mail_host', 'localhost').'>';
$recipients = $project->getNotificationRecipientsForTab('downloads');
foreach ($recipients as $address => $language) {
if ($this->get_submitter()->email === $address) {
continue;
}
Pluf_Translation::loadSetLocale($language);
$context = new Pluf_Template_Context(array(
'file' => $this,
'urlfile' => $this->getAbsoluteUrl($project),
'project' => $project,
'tags' => $this->get_tags_list(),
));
$tplfile = 'idf/downloads/download-created-email.txt';
$subject = __('New download - %s (%s)');
$headers = array('Message-ID' => $messageId);
if (!$create) {
$tplfile = 'idf/downloads/download-updated-email.txt';
$subject = __('Updated download - %s (%s)');
$headers = array('References' => $messageId);
}
$tmpl = new Pluf_Template($tplfile);
$text_email = $tmpl->render($context);
$email = new Pluf_Mail($from_email,
$address,
sprintf(__('New download - %s (%s)'),
sprintf($subject,
$this->summary,
$this->get_project()->shortname));
$project->shortname));
$email->addTextMessage($text_email);
$email->addHeaders($headers);
$email->sendMail();
}
Pluf_Translation::loadSetLocale($current_locale);
}
}
src/IDF/WikiRevision.php
243243
244244
245245
246
247
248
246
247
249248
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275249
276
277
278
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
279282
280
283
284
285
286
281287
288
282289
283290
284291
*/
public function notify($conf, $create=true)
{
if ('' == $conf->getVal('wiki_notification_email', '')) {
return;
}
$wikipage = $this->get_wikipage();
$project = $wikipage->get_project();
$current_locale = Pluf_Translation::getLocale();
$langs = Pluf::f('languages', array('en'));
Pluf_Translation::loadSetLocale($langs[0]);
$context = new Pluf_Template_Context(
array(
'page' => $this->get_wikipage(),
'rev' => $this,
'project' => $this->get_wikipage()->get_project(),
'url_base' => Pluf::f('url_base'),
)
);
if ($create) {
$template = 'idf/wiki/wiki-created-email.txt';
$title = sprintf(__('New Documentation Page %s - %s (%s)'),
$this->get_wikipage()->title,
$this->get_wikipage()->summary,
$this->get_wikipage()->get_project()->shortname);
} else {
$template = 'idf/wiki/wiki-updated-email.txt';
$title = sprintf(__('Documentation Page Changed %s - %s (%s)'),
$this->get_wikipage()->title,
$this->get_wikipage()->summary,
$this->get_wikipage()->get_project()->shortname);
}
$tmpl = new Pluf_Template($template);
$text_email = $tmpl->render($context);
$addresses = explode(',', $conf->getVal('wiki_notification_email'));
foreach ($addresses as $address) {
$email = new Pluf_Mail(Pluf::f('from_email'),
$from_email = Pluf::f('from_email');
$messageId = '<'.md5('wiki'.$wikipage->id.md5(Pluf::f('secret_key'))).'@'.Pluf::f('mail_host', 'localhost').'>';
$recipients = $project->getNotificationRecipientsForTab('wiki');
foreach ($recipients as $address => $language) {
if ($this->get_submitter()->email === $address) {
continue;
}
Pluf_Translation::loadSetLocale($language);
$context = new Pluf_Template_Context(array(
'page' => $wikipage,
'rev' => $this,
'project' => $project,
'url_base' => Pluf::f('url_base'),
));
$tplfile = 'idf/wiki/wiki-created-email.txt';
$subject = __('New Documentation Page %s - %s (%s)');
$headers = array('Message-ID' => $messageId);
if (!$create) {
$tplfile = 'idf/wiki/wiki-updated-email.txt';
$subject = __('Documentation Page Changed %s - %s (%s)');
$headers = array('References' => $messageId);
}
$tmpl = new Pluf_Template($tplfile);
$text_email = $tmpl->render($context);
$email = new Pluf_Mail($from_email,
$address,
$title);
sprintf($subject,
$wikipage->title,
$wikipage->summary,
$project->shortname));
$email->addTextMessage($text_email);
$email->addHeaders($headers);
$email->sendMail();
}
src/IDF/templates/idf/downloads/download-updated-email.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{trans 'Hello,'}
{blocktrans}A file download was updated:{/blocktrans}
{$file.summary|safe}
{$file} - {$file.filesize|ssize}
{trans 'Project:'} {$project.name|safe}
{trans 'Submitted by:'} {$file.get_submitter|safe}
{if $tags.count()}{trans 'Labels:'}
{foreach $tags as $tag} {$tag.class|safe}:{$tag.name|safe}
{/foreach}{/if}
{trans 'Download:'} {$urlfile}
{if $file.changelog}
{trans 'Description:'}
{$file.changelog}
{/if}
src/IDF/templates/idf/issues/issue-created-email.txt
11
22
3
4
3
54
65
76
{trans 'Hello,'}
{blocktrans}A new issue has been created and assigned
to you:{/blocktrans}
{if $owns_issue}{blocktrans}A new issue has been created and assigned to you:{/blocktrans}{else}{blocktrans}A new issue has been created:{/blocktrans}{/if}
{$issue.id} - {$issue.summary|safe}
{trans 'Project:'} {$project.name|safe}
src/IDF/templates/idf/issues/issue-updated-email.txt
11
22
3
3
44
55
66
{trans 'Hello,'}
{blocktrans}The following issue has been updated:{/blocktrans}
{if $owns_issue}{blocktrans}The following issue you are owning has been updated:{/blocktrans}{else}{blocktrans}The following issue has been updated:{/blocktrans}{/if}
{$issue.id} - {$issue.summary|safe}
{trans 'Project:'} {$project.name|safe}
src/IDF/templates/idf/source/commit-created-email.txt
22
33
44
5
5
66
7
7
88
9
10
11
9
10
11
1212
1313
14
14
1515
1616
17
17
{blocktrans}A new commit has been created:{/blocktrans}
{$c.summary|safe}
{$commit.summary|safe}
{trans 'Commit:'} {$c.scm_id|safe}
{trans 'Commit:'} {$commit.scm_id|safe}
{trans 'Project:'} {$project.name|safe}
{trans 'Created by:'} {$c.get_author|safe}
{trans 'Created at:'} {$c.creation_dtime|date:"%Y-%m-%d %H:%M:%S"}
{if $c.fullmessage}
{trans 'Created by:'} {$commit.get_author|safe}
{trans 'Created at:'} {$commit.creation_dtime|date:"%Y-%m-%d %H:%M:%S"}
{if $commit.fullmessage}
{trans 'Content:'}
{$c.fullmessage}
{$commit.fullmessage}
{/if}
--
{trans 'Commit details:'} {$url_base}{url 'IDF_Views_Source::commit', array($project.shortname, $c.scm_id)}
{trans 'Commit details:'} {$url_base}{url 'IDF_Views_Source::commit', array($project.shortname, $commit.scm_id)}

Archive Download the corresponding diff file

Page rendered in 0.12044s using 18 queries.