Hi everyone,
for quite a while now, I have tried to get some custom content in my Order Confirmation notification email but it won’t work. I need to include some special information and a link to a PDF, if a customer purchased certain products. It’s three different products and three different PDFs. Here is the code:
{% capture email_title %}Thanks for your purchase!{% endcapture %}
{% capture email_body %}
Hi {{ customer.first_name }},
we are preparing the next steps to get your purchase ready.
{% if line.title contains 'gift card' %}
You will receive your gift card code in a separate email shortly.
{% endif %}
{% if line.title contains 'Workshop' %}
Thanks for booking our workshop. You will find all the information in the PDF linked below. If you booked the workshop for someone else, you can also forward or print the PDF.
[Click here to access the PDF.](https://cdn.shopify.com/s/XXX.pdf)
{% endif %}
{% if line.title contains 'Workshop2' %}
Thanks for booking our workshop2. You will find all the information in the PDF linked below. If you booked the workshop for someone else, you can also forward or print the PDF.
[Click here to access the PDF.](https://cdn.shopify.com/s/XXX2.pdf)
{% endif %}
{% endcapture %}
I also already tried this with if in combination with elsif, as well as variations of line_title, line.product.title etc. Can anyone enlighten me, why this isn't working? Every Order Confirmation email just prints the stuff written before the first if statement.
I read through some threads here and through the documentation but I can't find a solution. I am not familiar with programming.
Looking forward to get this solved. Thanks!