News:

Support the VirtueMart project and become a member

Main Menu

Bug - sending two attachments in one email

Started by froston, May 02, 2017, 22:21:01 PM

Previous topic - Next topic

froston

Hi I found a bug and possible solution to it.

When I try to set up emails - sending custom attachment and creating invoice for the same order status, only the attachment is being sent.

Debugging I found the bug:
In component's view for invoice (root/components/com_virturmart/views/invoice/view.html.php) in function renderMailLayout, thr attachment always overwrites all the medias which have been set before ($this->mediaToSend = ...). Instead I suggest to use array_push and thus keep the previous variables.

Milbo

Thank you for reporting, but I wonder which version you use. The current version has

if(!empty($attach) and !$doVendor and in_array($this->orderDetails['details']['BT']->order_status,VmConfig::get('attach_os',0)) ){
$attachment = explode(',',$attach);
foreach($attachment as $file){
$this->mediaToSend[] = VMPATH_ROOT.'/'.VmConfig::get('media_vendor_path','').'/'.trim($file);
}
}


Please use vm3.2.1 :-)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

froston

You're right Im using VirtueMart 3.0.18 ... Thanks!