diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 7e957385e60..0844cff2057 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1243,34 +1243,34 @@ class EmailCollector extends CommonObject $objectid = 0; $objectemail = null; - if ($reg[0] == 'inv') + if ($reg[1] == 'inv') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new Facture($this->db); } - if ($reg[0] == 'proj') + if ($reg[1] == 'proj') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new Project($this->db); } - if ($reg[0] == 'con') + if ($reg[1] == 'con') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new Contact($this->db); } - if ($reg[0] == 'thi') + if ($reg[1] == 'thi') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new Societe($this->db); } - if ($reg[0] == 'use') + if ($reg[1] == 'use') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new User($this->db); } - if ($reg[0] == 'tic') + if ($reg[1] == 'tic') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new Ticket($this->db); } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index cf1e2502676..f5132809dd1 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2753,7 +2753,8 @@ class Ticket extends CommonObject $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $receiver, $from, $message_to_send, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); + $trackid = "tic".$this->id; + $mailfile = new CMailFile($subject, $receiver, $from, $message_to_send, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid); if ($mailfile->error) { setEventMessages($mailfile->error, null, 'errors'); } else {