sm5k Posted February 20, 2014 Share Posted February 20, 2014 (edited) Hi Community, according to german law i have to send several pdfs with my outgoing E-mails as attachment. These PDFs are predefined and not generated instant for every customer. I read about this topic and found out that it isn`t possible to add dynamic Pdfs. But what about static PDFs? Seems not that hard to get it in there but don`t know how to. Anyone got an idea where to start? Thx a lot. SM5K Edited February 21, 2014 by sm5k (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted February 21, 2014 Share Posted February 21, 2014 I would try to put a page break in /pdf/invoice.tpl file and attach the extra static pages after that. Link to comment Share on other sites More sharing options...
bellini13 Posted February 21, 2014 Share Posted February 21, 2014 Assuming you have saved the PDF's on your server in a predefined folder, then I would edit the Mail class and add code that would attach these PDF's to every email that is sent. This assumes you have to attach these PDF's to every single email. If this is a wrong assumption, then please state exactly which emails you need to include these attachments in. Link to comment Share on other sites More sharing options...
sm5k Posted February 21, 2014 Author Share Posted February 21, 2014 Hi thank you for your answers. Found several issues on this topic. I attached the following code on mail.php in /classes. /* E-Mail Anhänge wiederrufsbelehrung und AGB - */ $file = _PS_ROOT_DIR_ . '/yourfolderforemailattachments/test.pdf'; $message->attach(new Swift_Message_Attachment(file_get_contents($file), 'test.pdf', 'application/pdf')); $file = _PS_ROOT_DIR_ . '/yourfolderforemailattachments/test2.pdf'; $message->attach(new Swift_Message_Attachment(file_get_contents($file), 'test2.pdf', 'application/pdf')); Works now Greetz and thanx to everybody. SM5K Link to comment Share on other sites More sharing options...
Recommended Posts