Browse Source

Better way to keep track that an e,ail is linked to a given iTOp object: message-id + references

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1633 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 13 years ago
parent
commit
8ee0c0419b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      core/action.class.inc.php

+ 5 - 2
core/action.class.inc.php

@@ -275,6 +275,7 @@ class ActionEmail extends ActionNotification
 	protected function _DoExecute($oTrigger, $aContextArgs, &$oLog)
 	protected function _DoExecute($oTrigger, $aContextArgs, &$oLog)
 	{
 	{
 		$sPreviousUrlMaker = ApplicationContext::SetUrlMakerClass();
 		$sPreviousUrlMaker = ApplicationContext::SetUrlMakerClass();
+		$aHeaders = array();
 		try
 		try
 		{
 		{
 			$this->m_iRecipients = 0;
 			$this->m_iRecipients = 0;
@@ -294,7 +295,9 @@ class ActionEmail extends ActionNotification
 			$sBody = MetaModel::ApplyParams($this->Get('body'), $aContextArgs);
 			$sBody = MetaModel::ApplyParams($this->Get('body'), $aContextArgs);
 			
 			
 			$oObj = $aContextArgs['this->object()'];
 			$oObj = $aContextArgs['this->object()'];
-			$sReference = '<iTop/'.get_class($oObj).'/'.$oObj->GetKey().'>';
+			$sMessageId = sprintf('<iTop_%s_%d_%f@%s.openitop.org>', get_class($oObj), $oObj->GetKey(), microtime(true /* get as float*/), MetaModel::GetConfig()->Get('session_name'));
+			$sReference = $sMessageId;
+			$aHeaders['Message-ID'] = $sMessageId;
 		}
 		}
 		catch(Exception $e)
 		catch(Exception $e)
 		{
 		{
@@ -315,7 +318,7 @@ class ActionEmail extends ActionNotification
 			if (isset($sBody))     $oLog->Set('body', $sBody);
 			if (isset($sBody))     $oLog->Set('body', $sBody);
 		}
 		}
 
 
-		$oEmail = new EMail();
+		$oEmail = new EMail('', '', '', $aHeaders);
 
 
 		if ($this->IsBeingTested())
 		if ($this->IsBeingTested())
 		{
 		{