Added ticket 414, references email header for the issue notifications.

master
Loic d'Anterroches 2010-03-16 09:41:21 +01:00
parent 4e7d3618a7
commit 0056e3f0b2
1 changed files with 3 additions and 1 deletions

View File

@ -246,7 +246,7 @@ class IDF_Issue extends Pluf_Model
$langs[0]); $langs[0]);
} }
$current_locale = Pluf_Translation::getLocale(); $current_locale = Pluf_Translation::getLocale();
$id = '<'.md5($this->id.md5(Pluf::f('secret_key'))).'@'.Pluf::f('mail_host', 'localhost').'>';
if ($create) { if ($create) {
if (null != $this->get_owner() and $this->owner != $this->submitter) { if (null != $this->get_owner() and $this->owner != $this->submitter) {
$email_lang = array($this->get_owner()->email, $email_lang = array($this->get_owner()->email,
@ -271,6 +271,7 @@ class IDF_Issue extends Pluf_Model
$this->id, $this->summary, $prj->shortname)); $this->id, $this->summary, $prj->shortname));
$tmpl = new Pluf_Template('idf/issues/issue-created-email.txt'); $tmpl = new Pluf_Template('idf/issues/issue-created-email.txt');
$email->addTextMessage($tmpl->render($context)); $email->addTextMessage($tmpl->render($context));
$email->addHeaders(array('Message-ID'=>$id));
$email->sendMail(); $email->sendMail();
} }
} else { } else {
@ -316,6 +317,7 @@ class IDF_Issue extends Pluf_Model
$this->id, $this->summary, $prj->shortname)); $this->id, $this->summary, $prj->shortname));
$tmpl = new Pluf_Template('idf/issues/issue-updated-email.txt'); $tmpl = new Pluf_Template('idf/issues/issue-updated-email.txt');
$email->addTextMessage($tmpl->render($context)); $email->addTextMessage($tmpl->render($context));
$email->addHeaders(array('References'=>$id));
$email->sendMail(); $email->sendMail();
} }
} }