Commit 9c4fafac authored by Giovannoni Laurent's avatar Giovannoni Laurent

Merge branch 'develop' into 'master'

FEAT #7 add headers in email

See merge request !16
parents 30a2bd2e 46c3fcc1
......@@ -1200,8 +1200,11 @@ class MailCapture
# Replace document source if HTML found after PLAIN
@unlink($Document->path);
$subject = $Document->getMetadata("subject");
$fromaddress = $Document->getMetadata("fromaddress");
$doc_date = $Document->getMetadata("doc_date");
$toaddress = $Document->getMetadata("toaddress");
$ccaddress = $Document->getMetadata("ccaddress");
libxml_use_internal_errors(true);
......@@ -1209,12 +1212,26 @@ class MailCapture
$doc->loadHTMLFile($part->filepath);
$body = $doc->getElementsByTagName('body');
if ($this->addHeaderInMailContent) {
$metadatas_doc_date= $doc->createElement("p", "");
$metadatas_doc_date = $doc->createElement("p", "");
$body->item(0)->insertBefore($metadatas_doc_date, $body->item(0)->firstChild);
$metadatas_doc_date= $doc->createElement("div", "Reçu le : ".$doc_date);
$body->item(0)->insertBefore($metadatas_doc_date, $body->item(0)->firstChild);
$metadatas_ccaddress = $doc->createElement("div", "Cc : ".$ccaddress);
$body->item(0)->insertBefore($metadatas_ccaddress, $body->item(0)->firstChild);
$metadatas_toaddress = $doc->createElement("div", "Pour : ".$toaddress);
$body->item(0)->insertBefore($metadatas_toaddress, $body->item(0)->firstChild);
$metadatas_doc_date = $doc->createElement("div", "Date : ".$doc_date);
$body->item(0)->insertBefore($metadatas_doc_date, $body->item(0)->firstChild);
$metadatas_fromaddress = $doc->createElement("div", "Envoyé par : ".$fromaddress);
$metadatas_fromaddress= $doc->createElement("div","De : ".$fromaddress);
$body->item(0)->insertBefore($metadatas_fromaddress, $body->item(0)->firstChild);
$metadatas_subject = $doc->createElement("div", "Objet : ".$subject);
$body->item(0)->insertBefore($metadatas_subject, $body->item(0)->firstChild);
}
$doc->saveHTMLFile($part->filepath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment