Jump to content

[Solved] Attach static pdf in email


Recommended Posts

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 by Gronneunger.dk (see edit history)
Link to comment
Share on other sites

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! :blink:  :D 

 

I would check if

file_get_contents("/mail/da/standardfortrydelsesformular.pdf")

really obtains content of the PDF.

Link to comment
Share on other sites

×
×
  • Create New...