Jump to content
VirtualGarage

Attach an extra PDF to order confirmation e-mail

Recommended Posts

Hello,

i'm trying to add a PDF (our law says we have to send Terms and conditions as attachment to the email) to the order confirmation email, but only found this

https://www.prestashop.com/forums/topic/532204-solved-attach-an-extra-pdf-to-order-confirmation-e-mail/

which does not work in version 1.7.4.3 ... i also looked if there were any modules, but the one that has this capability, says is works up to ver 1.7.2.5 ...

pls did I miss something somewhere or am just blind?

Thank you!

Share this post


Link to post
Share on other sites

Hello,

for Prestashop 1.7.6  - add Terms to order_confirmation email.

classes/Mail.php

before this code: (line cca 570)

if ($fileAttachment && !empty($fileAttachment)) {
                // Multiple attachments?
                if (!is_array(current($fileAttachment))) {
                    $fileAttachment = array($fileAttachment);
                }

 

add this source:

if ($template == 'order_conf'){
	$message->attach(\Swift_Attachment::newInstance(file_get_contents('terms.pdf'), 'terms.pdf', 'application/pdf'));
	$message->attach(\Swift_Attachment::newInstance(file_get_contents('return_money.pdf'), 'return_money.pdf', 'application/pdf'));
}  

files term.pdf and return_money.pdf are in root directory of Prestashop

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More