Store owners often want to attach a PDF file with the Return Policy or Terms and Conditions.
Attaching store policies to an order confirmation email in an ecommerce store has several advantages, including:

While it may not be required by law to attach store policies to an order confirmation email, it is highly recommended to do so. It can help set clear expectations and prevent misunderstandings, which can lead to a better customer experience and fewer disputes.

If you have a Shopify store, you can achieve that by following the instructions below.


Go to Settings > Notifications > Order confirmation email

Click Edit code, then add the following code to the top then save:

{{ shop.terms_of_service | attach_as_pdf: "Terms of Service" }}
{{ shop.refund_policy | attach_as_pdf: "Refund policy" }}
{{ shop.privacy_policy | attach_as_pdf: "Privacy Policy" }}
{{ shop.shipping_policy | attach_as_pdf: "Shipping Policy" }}
{{ shop.contact_information | attach_as_pdf: "Contact Information" }}
Store policies as PDF attachments in Shopify

The term in quotation marks can be changed to whatever you want the PDF and the document to be titled.
The code above attaches all the policies as PDF files. If you just some of them, you can just paste the lines that correspond the policies you need.
Unfortunately this is only possible with the contents of store policies.

You can then click Preview and Send test email to see the results.

Here is what it will look like in the email if you attach all of the policies:

Store policies as PDF attachments in Shopify


Can I attach the contents of a regular Shopify page as PDF?

No. Unfortunately the all_pages object is not available in the notification emails.

This is not working and I am seeing a message "Liquid error: internal".

If you are seeing that, your code is incorrect. Double check if the code you pasted is correct. Every character is important.

Support me

💸💸 This is all free for now and made on my spare time, as an indie developer. If you like my work and it helps you make or save money, please consider buying me a coffee! (or an entire coffee maker) 💸💸

For questions, concerns, requests or feedback, message me.

❮ Back to Shopify Guides