Display different Texts in order confirmation

Hello there!

I want to differentiate between two e-mail bodys in my order confirmation.

The first version should display if a product with one of it’s two varaints were ordered.

The varaints have the SKU “D003” and “D004”

The second version should display if one of the other products were ordered.

My approach was:

First to assign a variable to the line_item where I map over the SKUs

{% assign item_sku = line_items | map: "sku" %}

then check in the e-mail body if item_sku contains the sku “D003” or “D004”

{% if item_sku contains "D003" or "D004"%}
Text version one
{% else %}
Text version two
{% endif %}

If I display the SKU with {{ item_sku }}, I get the right SKU(s). So I guess something must be wrong with the conditional statement.

Any help would be appreciated :slightly_smiling_face: