Jump to content

How to attach an invoice PDF file to emails?


Recommended Posts

Hi, 

 

I know this has been an issue for many of us. Still I am not able to find any FREE solution to this problem whatsoever. I am using Prestashop version 1.6.x.x and there in my email template there is a link to the invoice that customer must click to and finally he can download his .pdf invoice. 

 

Now I need that the invoice PDF file is directly attached to my email so the customer can just click on the attached PDF file to download or open it.

 

I have read somewhere that I should comment this code below ↓↓↓ in class PaymentModule.php like this:

// Join PDF invoice
/*if ((int)Configuration::get('PS_INVOICE') && $order_status->invoice && $order->invoice_number) {
   $order_invoice_list = $order->getInvoicesCollection();
   Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list));
   $pdf = new PDF($order_invoice_list, 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';
} else {
   $file_attachement = null;
}*/

Unfortunately I don´t have an access to these files yet. Could You please try this solution ↑↑↑ for me and tell me please if this solution ↑↑↑ is correct and if it works?

 

Thank You Friends.

Edited by Call_me_Dave (see edit history)
Link to comment
Share on other sites

What email exactly? The invoice should be attached automatically to the order confirmation email and attaching it can be set for each order status.

 

Yes, It is automatically attached to my email but as a link to my shop backoffice and customer´s order page - like this: http://oi67.tinypic.com/whbsqt.jpg

 

But what I need is a direct attachment to email like this: http://imgh.us/seee.png

 

Do You understand now what is the difference?

 

I would like to attach this invoice PDF file to customer´s order confirmation emails.

Edited by Call_me_Dave (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...