How can I correctly edit an email template for different product variants?

Samik1
Visitor
3 0 1

{% if line.variant.title == 'ProductName/VaraintName' %}
You are buying some awesome shoes!
{% endif %}

 

What am I doing wrong here. I am trying to input this in the email template and depending on which Variant they order I want to display such comments 

Reply 1 (1)

made4Uo
Shopify Partner
3805 713 1129

Hi @Samik1 , 

 

I am assuming this is for the order confirmation email. You have the right code. Make sure you have the exact product title though. You can try pasting the code below to check the line.variant.title and make dummy product with zero cost. Buy that product and check your email.

 

          {% if line.variant.title != blank %}
            <span class="order-list__item-variant">The variant title is: {{ line.variant.title }}</span><br/>
          {% endif %}

 

Volunteering to assist you!  Likes and Accept as Solution  is highly appreciated.✌
Coffee fuels my dedication. If helpful, a small Coffee Tip would be greatly appreciated.
Need EXPERIENCED Shopify developer without breaking the bank?
Hire us at Made4Uo.com for quick replies.
Stay in control and maintain your security by avoiding unnecessary store access!