Attachment to "Staff order notification".

familymatic
New Member
2 0 0

Hello,

I am trying to attach an file (can be html, csv, pdf, json.....) containing the "Order ID" (variable name= "id") to the "Staff Order Notification mail" (Admin panel -> settings -> notifications -> Staff order notifications) for future reference. 
 
Actually this should be a quite simple process because these emails are (partially) dynamically generated using liquid.
But I cannot get this one working, have tried a lot, searched a lot, but no chance :-(
 
The things that I managed to to is displaying the actual "id" in the email (simply: {{ id }}), and even attaching a .pdf to the email containing, for example the Terms&Conditions (e.g. {{ shop.terms_of_service | attach_as_pdf: "Terms-of-Service" }}).
 
Any Ideas, how this could be done?
 
P.s. I do not want to use an APP for such a simple problem.
 
Many thanks,
 
             Familymatic

0 Likes

Hi @familymatic 

 

I'm afraid that it's not possible to dynamically generate attachments in Shopify email notifications. You can only attach static files like Terms of Service, Refund Policy or Privacy Policy.

 

Why do you need the Order ID as an attachment? Is this for an integration with another system?

 

Thanks,
Lukasz

I'm a software engineer. I make things happen automatically.
0 Likes
familymatic
New Member
2 0 0

Hello Lukasz,

 

Thank you for your reply.

 

I understand that the Terms of service is a “static” file, if I understand it correctly this file is presented to the script via an Object (“shop.terms_of_service”), the “id” also is an Object, so I do not quite understand why one is working the other isn't.

 

N.b. My first thought was the classic “Integer-String problem”, but this wasn’t the problem either (I have presented the “id” as a string to the script).

 

Thanks,

 

Familymatic

 

0 Likes

Yeah, for me it's also not quite clear why one string can be attached as PDF, while the other can't. The attach_as_pdf filter is only mentioned in the documentation for Selling in Germany. My assumption is that the PDF files containing Temrs of Service or Refund Policy are not generated on the fly, but rather cached on the server, as they don't change too often. Anyway, this is only my interpretation. Would be great if somone from the Shopify Team clarified it.

I'm a software engineer. I make things happen automatically.
cheesecakemania
Tourist
7 0 2

Had a similar issue and was stumped when I found out that attach_as_pdf is not even mentioned in the API docs. o_O  Do you have any suggestion for a ready-made Shopify app that can attach a PDF (and possible even generate them using a template system)?

0 Likes