Dear All!
This is the situation:
For every order whose status is changed to the custom status "Confirmed" an email should leave to the supplier with an xml file in attach (it contains addresses, product details etc).
Now, I implemented a function in Order.php of which I show you the relevant parts:
/* Attachment File */
// Attachment location
$file_name = $order_id.".xml";
$path = "../orders/";
// Read the file content
$file = $path.$file_name;
$file_size = filesize($file);
$handle = fopen($file, "r");
$content = fread($handle, $file_size);
fclose($handle);
$content = chunk_split(base64_encode($content));
...
Mail::Send(
5,
'new_order',
'New Order',
array(),
'
[email protected]',
'Provider',
NULL,
'My ePortal',
array('{content}' => $content,'{mime}' => 'application/xml', '{name}' => $file),
NULL,
_PS_MAIL_DIR_
);
The email is sent correctly to
[email protected] but WITHOUT the attachment.
Could anyone tell me what I am doing wrong here?
Thank you very much
Best Regards
Henrik