How to attach terms of service as a PDF file to Shopify notification emails?
In certain countries, particularly those within the European Union, merchants are required by law to provide customers with the terms of service in a clear text format at the time of purchase. This is usually when you send the order confirmation email to your customers.
To comply with these regulations, the terms of service must be delivered in a durable format that can be saved and accessed later—such as a PDF file. Simply providing a link to your store’s policies is not enough under the EU directive, and for good reason. Content accessible through a link can change or be updated over time, which would prevent customers from accessing the version of the terms that applied when they made their purchase.
Let’s explore how to easily attach the terms of service as a PDF file to the order confirmation email, along with other important documents like the refund policy.
Add store polices as “Policies” not “Pages”
We often see merchants add their store policies, like terms of service or refund policies, as plain pages. However, Shopify provides a dedicated section for these in Settings → Policies.
We recommend adding all policies to their designated sections instead of creating custom pages. Here’s why: Shopify reserves shop.policy
for each policy type (e.g., shop.terms_of_service
, making it easier to render policy links across your storefront or include them as PDF files in emails.
For example, at checkout—which is not easily customizable unless you’re on Shopify Plus—policies added through the designated section automatically display in the footer on the checkout page. See the screenshot below.
Additionally, some Shopify themes include e.g., checkboxes for linking to the terms of service (e.g., in the cart), but these features won’t work automatically if policies are uploaded as custom pages instead of being added to the designated policies section.
However, we understand the limitations. Policies have fixed URL handles (e.g., terms-of-service
) that cannot be customized or translated, unlike custom pages, which provide more flexibility. For example, if your store operates in French, the terms of service URL handle will still appear in English. Additionally, the design options for policy pages are more limited for non-technical users and may not offer the same ease of customization as regular pages.
Add terms of service as a PDF file to the order confirmation email
Follow these steps to easily attach the terms of service as a PDF file to your order confirmation emails:
- Ensure your terms of service are added in Settings → Policies.
- Navigate to Settings → Notifications.
-
Select Customer Notifications → Order Confirmation, then click the Edit button.
-
Note: If the Edit option isn’t available, make sure to verify your sender email first.
-
Scroll to the very bottom of the email template and add the following code snippet:
{{ shop.terms_of_service | attach_as_pdf: "Terms of Service" }}
-
Once the code is added, save the changes.
-
If desired, you can also attach additional policies, such as the refund and return policy or shipping policy, by replacing the policy name in the code snippet. For example:
{{ shop.refund_policy | attach_as_pdf: "Refund and returns policy }} {{ shop.shipping_policy | attach_as_pdf: "Shipping policy" }}
-
Place a test order to ensure the terms of service and any other policies (if using) are correctly attached to your email.
We hope this guide helps you set everything up smoothly! If you have any questions, feel free to reach out to us.