Jump to content

Order Confirmation Email Pdf attachment not working corrupt! - 1.5.14


Recommended Posts

Hi,
 
     I am using latest prestashop version PS 1.5.14. I am not able to receive Order Confirmation email on the customer side after placing order. It seems following code inside PaymentModule.php is not able to create a valid pdf that is not able to get attached.

$pdf = new PDF($order->getInvoicesCollection(), PDF::TEMPLATE_INVOICE, $this->context->smarty);
$file_attachement['content'] = $pdf->render(false);
$file_attachement['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)$order->id_lang, null, $order->id_shop).sprintf('%06d', $order->invoice_number).'.pdf';
$file_attachement['mime'] = 'application/pdf';

However, when I change the following line of code, I am able to receive Order Confirmation email but the attached pdf is corrupt.

$file_attachement['content'] = $pdf->render();

Anyone having any idea how to resolve the issue? I tried going through following posts but didn't have a luck.

 

https://www.prestashop.com/forums/topic/75045-attachments-to-e-mails/page-2

https://www.prestashop.com/forums/topic/226737-attach-pdf-on-emails/

https://www.prestashop.com/forums/topic/623[spam-filter]invoice-pdfs-not-being-emailed/

https://www.prestashop.com/forums/topic/199655-why-my-invoices-are-not-attached-to-mails/page-2

 

Link to comment
Share on other sites

×
×
  • Create New...