Gronneunger.dk Posted October 15, 2014 Share Posted October 15, 2014 (edited) I would like to attach a static returnote to my confirmation emails.And no, a link within the email will no be good enough - I wish it would, but the law in Denmark states otherwise. Googling and searching this forum has given me this code: // Attach returnote if ($template == 'da/order_conf') $message->attach(new Swift_Message_Attachment(file_get_contents("/mail/da/standardfortrydelsesformular.pdf"), "standardfortrydelsesformular.pdf", "application/pdf")); It's a step in the right direction, but this only results in an empty pdf file being attached. Has anybody solved this and are willing to enlighten me on the secret? I would be grateful! Edited October 16, 2014 by Gronneunger.dk (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted October 16, 2014 Share Posted October 16, 2014 I would check if file_get_contents("/mail/da/standardfortrydelsesformular.pdf") really obtains content of the PDF. 1 Link to comment Share on other sites More sharing options...
Gronneunger.dk Posted October 16, 2014 Author Share Posted October 16, 2014 Oh. My. Freaking. God! That's so embarrasing. Well, sure - that might be a really clever step to check the link, and no, I didn't do it. And yes, that solved my problem!So thanks, for being the new eyes I obviously needed! I would check if file_get_contents("/mail/da/standardfortrydelsesformular.pdf") really obtains content of the PDF. Link to comment Share on other sites More sharing options...
Recommended Posts