Duration KPI added on sending email.

SVN:trunk[5125]
This commit is contained in:
Eric Espié
2017-11-02 16:43:00 +00:00
parent 51a60e637c
commit 96296fe211

View File

@@ -195,18 +195,29 @@ class EMail
$aFailedRecipients = array();
$this->m_oMessage->setMaxLineLength(0);
$iSent = $oMailer->send($this->m_oMessage, $aFailedRecipients);
if ($iSent === 0)
$oKPI = new ExecutionKPI();
try
{
// Beware: it seems that $aFailedRecipients sometimes contains the recipients that actually received the message !!!
IssueLog::Warning('Email sending failed: Some recipients were invalid, aFailedRecipients contains: '.implode(', ', $aFailedRecipients));
$aIssues = array('Some recipients were invalid.');
return EMAIL_SEND_ERROR;
$iSent = $oMailer->send($this->m_oMessage, $aFailedRecipients);
if ($iSent === 0)
{
// Beware: it seems that $aFailedRecipients sometimes contains the recipients that actually received the message !!!
IssueLog::Warning('Email sending failed: Some recipients were invalid, aFailedRecipients contains: '.implode(', ', $aFailedRecipients));
$aIssues = array('Some recipients were invalid.');
$oKPI->ComputeStats('Email Sent', 'Error received');
return EMAIL_SEND_ERROR;
}
else
{
$aIssues = array();
$oKPI->ComputeStats('Email Sent', 'Succeded');
return EMAIL_SEND_OK;
}
}
else
catch (Exception $e)
{
$aIssues = array();
return EMAIL_SEND_OK;
$oKPI->ComputeStats('Email Sent', 'Error received');
throw $e;
}
}