Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions datamodel.itop-standard-email-synchro.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1196,15 +1196,20 @@ EOF
$sRejectionReply = $this->Get('unknown_caller_rejection_reply');
if (!empty($sRejectionReply) && $oRawEmail)
{
$sReplySubject = '[iTop] '.$oEmail->sSubject.' - '.$this->sLastError;
$sReplyBody = str_replace("\n", "<br/>", $sRejectionReply);
$sReplyTo = $oEmail->sCallerEmail;
$aTo = $oRawEmail->GetTo();
$sReplyFrom = $aTo[0]['email'];
$this->Trace("From: ".$sReplyFrom."\nTo: ".$sReplyTo."\n".$sReplySubject."\n\n".$sReplyBody);
$oRawEmail->SendAsAttachment($sReplyTo, $sReplyFrom, $sReplySubject, $sReplyBody);
// do not send rejection reply in case of an auto reply
if(!method_exists($oEmail, "IsAutoReplyEmail") || !$oEmail->IsAutoReplyEmail()){
$sReplySubject = '[iTop] '.$oEmail->sSubject.' - '.$this->sLastError;
$sReplyBody = str_replace("\n", "<br/>", $sRejectionReply);
$sReplyTo = $oEmail->sCallerEmail;
$aTo = $oRawEmail->GetTo();
$sReplyFrom = $aTo[0]['email'];
$oRawEmail->SendAsAttachment($sReplyTo, $sReplyFrom, $sReplySubject, $sReplyBody);

$this->sLastError .= " - Replied to sender on ".date('r');
$this->sLastError .= " - Replied to sender on ".date('r');
} else {
$this->Trace("Email ignored as it was considered as an auto-reply");
}
$this->Trace("From: ".$sReplyFrom."\nTo: ".$sReplyTo."\n".$sReplySubject."\n\n".$sReplyBody);
}

// Send to contact
Expand Down