- Keep track of the object at the source of any email notification for further correlation (either in the user's mailbox or for automatic processing of incoming emails)

SVN:trunk[943]
This commit is contained in:
Denis Flaven
2010-11-12 16:34:50 +00:00
parent effa212261
commit 259b266a19
2 changed files with 14 additions and 2 deletions

View File

@@ -235,6 +235,10 @@ class ActionEmail extends ActionNotification
$sSubject = MetaModel::ApplyParams($this->Get('subject'), $aContextArgs);
$sBody = MetaModel::ApplyParams($this->Get('body'), $aContextArgs);
$oObj = $aContextArgs['this->object()'];
$sServerIP = gethostbyname(gethostname());
$sReference = '<iTop/'.get_class($oObj).'/'.$oObj->GetKey().'@'.$sServerIP.'>';
$oEmail = new EMail();
@@ -251,12 +255,14 @@ class ActionEmail extends ActionNotification
$sTestBody .= "<li>BCC: $sBCC</li>\n";
$sTestBody .= "<li>From: $sFrom</li>\n";
$sTestBody .= "<li>Reply-To: $sReplyTo</li>\n";
$sTestBody .= "<li>References: $sReference</li>\n";
$sTestBody .= "</ul>\n";
$sTestBody .= "</p>\n";
$sTestBody .= "</div>\n";
$oEmail->SetBody($sTestBody);
$oEmail->SetRecipientTO($this->Get('test_recipient'));
$oEmail->SetRecipientFrom($this->Get('test_recipient'));
$oEmail->SetReferences($sReference);
}
else
{
@@ -267,6 +273,7 @@ class ActionEmail extends ActionNotification
$oEmail->SetRecipientBCC($sBCC);
$oEmail->SetRecipientFrom($sFrom);
$oEmail->SetRecipientReplyTo($sReplyTo);
$oEmail->SetReferences($sReference);
}
if (empty($this->m_aMailErrors))
@@ -339,4 +346,4 @@ class ActionEmail extends ActionNotification
}
}
}
?>
?>

View File

@@ -89,6 +89,11 @@ class EMail
$this->m_aHeaders[$sKey] = $sValue;
}
}
public function SetReferences($sReferences)
{
$this->AddToHeader('References', $sReferences);
}
public function SetBody($sBody)
{
@@ -132,4 +137,4 @@ class EMail
}
?>
?>