Fixed issue 114, email sent in language of commenter.

This commit is contained in:
Loic d'Anterroches
2009-10-08 11:23:33 +02:00
parent ec8ff4f76b
commit b6c5e803cb
16 changed files with 312 additions and 192 deletions

View File

@@ -175,21 +175,7 @@ class IDF_Form_Upload extends Pluf_Form
$upload->setAssoc($tag);
}
// Send the notification
if ('' != $this->project->getConf()->getVal('downloads_notification_email', '')) {
$context = new Pluf_Template_Context(
array('file' => $upload,
'urlfile' => $upload->getAbsoluteUrl($this->project),
'project' => $this->project,
'tags' => $upload->get_tags_list(),
));
$tmpl = new Pluf_Template('idf/downloads/download-created-email.txt');
$text_email = $tmpl->render($context);
$email = new Pluf_Mail(Pluf::f('from_email'), $this->project->getConf()->getVal('downloads_notification_email'),
sprintf(__('New download - %s (%s)'),
$upload->summary, $this->project->shortname));
$email->addTextMessage($text_email);
$email->sendMail();
}
$upload->notify($this->project->getConf());
return $upload;
}
}