VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: froston on May 02, 2017, 22:21:01 PM

Title: Bug - sending two attachments in one email
Post by: froston on May 02, 2017, 22:21:01 PM
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.
Title: Re: Bug - sending two attachments in one email
Post by: Milbo on May 03, 2017, 07:48:19 AM
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 :-)
Title: Re: Bug - sending two attachments in one email
Post by: froston on May 03, 2017, 18:50:34 PM
You're right Im using VirtueMart 3.0.18 ... Thanks!