How can I add product-specific text to order confirmation emails?

I’m trying to add a certain line of text to the order confirmation email if a certain product has been ordered. I’ve tried multiple things but still appears empty on test emails

I’ve also tried using {{product.title}} but that doesn’t work either.

Can anyone please help me sort this out? Thank you

If you could help that would be perfect

Hi @XfinityStore

It should be {{ line.product.title }}.

Try it and let me know

Have you tried this?

{% for line_item in line_items %}
{% if line_item.product.title == 'xyz' %}
This appears only for xyz
{% endif %}
{% endfor %}

Ok will do, I think I tried it earlier but can’t remember so I’ll try again

Hi @XfinityStore

Try it and let me know

I will do

I haven’t tried that yet either I’ll try both

Should I use this code

{{ line.product.title }} with

{% for line_item in line_items %} {% if line_item.product.title == ‘xyz’ %} This appears only for xyz {% endif %} {% endfor %}

I added it to my txt file but it says body html liquid syntax error: ‘if’ tag was never closed

HI @XfinityStore
Can you share all of your code?

Yes I’ll send over it now

I use Bayengage for my template

@XfinityStore

Could you share the whole code?, then I can review it

i can’t send it here, it says theres something included-that shouldn’t be, is there any other way to send it, i’ll try sending it to your email: expert.rookie.team@gmail.com

@XfinityStore

You can put it in a .txt file and send it to my email expert.rookie.team@gmail.com

just sent it over

@XfinityStore

I checked but there is not {% if %} liquid code in the file you sent. I dont know what is your error “I added it to my txt file but it says body html liquid syntax error: ‘if’ tag was never closed” ?

"

under what {{}} did you make it, e.g. {{ product.title }}