Ticket: Sending email notification with the empty some fields

Hi Team!
I found out some problems with the module ticket “Create new ticket”. If you set up the email notification in the ticket module. You can send the email notification when creating the ticket. But some fields are the null value and no image attached in spite of I uploaded before.

I tried creating the new ticket in the public area: “dolibarr\htdocs\public\ticket\create_ticket.php”. And the result showed all information with the attached image.

After I checked the code, I found out the source code to send email notification in the ticket module got a problem. Followed the code from the ticket public. I changed something:

  1. Notification email function called by the trigger file: “dolibarr\htdocs\core\triggers\interface_50_modTicket_TicketEmail.class”

Blockquote
lines 128 → 131. Case “TICKET_ASSIGNED”.
// Init to avoid errors
$filepath = array();
$filename = array();
$mimetype = array();

Changing to:
$formmail = new FormMail($this->db);

// Init to avoid errors
$filepath = array();
$filename = array();
$mimetype = array();

$attachedfiles = $formmail->get_attached_files();
$filepath = $attachedfiles[‘paths’];
$filename = $attachedfiles[‘names’];
$mimetype = $attachedfiles[‘mimes’];

Blockquote

Do it with the same case “TICKET_CREATE”. Lines: 196 (original code).
This time will make the attached file is sending with the email. But It’s got an error. You can see the last image attached before when creating a new ticket with the same session (Including public area too).

Next one you need to modify the code to load the information. I tried to change the code:
In the same files

Blockquote
Lines: 187 (Original code)
$object->fetch(‘’, $object->track_id); // Should be useless ← I don’t know this comment what it’s mean.

Changing to:
$object->fetch($object->track_id); // Should be useless

Blockquote
After modification, all information and images can be attached to the email.

I hope this feature can be fixed in the next update version. Thank you.
Dolibarr Version: 11.0.3.
Dolibarr version checked: 11.0.4.