# 通知メールの条件分岐について

**URL:** <https://community.shopify.com/t/topic/278152>\
**Category:** 技術的なQ＆A\
**Created:** [December 18, 2023, 3:01am UTC](https://community.shopify.com/t/topic/278152 "2023-12-18T03:01:14Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![ho-jo](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@ho-jo](https://community.shopify.com/u/ho-jo)\
**Post date:** [December 18, 2023, 3:01am UTC](https://community.shopify.com/t/topic/278152/1 "2023-12-18T03:01:14Z")

</div>

通知メールのカスタマイズで以下２つ質問です。

１、購入された商品の商品タイプによって通知メールの文言を条件分岐させることは可能でしょうか。

調べたのですが変数がなさそうだったので質問させていただきました。

参考：[https://help.shopify.com/ja/manual/orders/notifications/email-variables#line-item-properties](https://help.shopify.com/ja/manual/orders/notifications/email-variables#line-item-properties)

２、もし変数がない場合、商品タイトルで条件分岐させようと思ったのですが、こちらもうまくできません。

やりたいことは3パターンに分けることなのですが、ifなのかunlessがふさわしいのかも困っております。

ご教示お願いいたします。

・販売商品のみ含まれていた場合の文面 A

・買取商品のみ含まれていた場合の文面 B

・両方含まれていた場合の文面 C

```auto
{% for line in line_items %}
{% for title in line.title %}
{% unless line.title contains '買取' %}
A
{% else unless line.title contains '販売' %}
B
{% else %}
C（AもBも両方とも含まれる場合） 
{% endunless %}
{% endfor %}
{% endfor %}

```

---

_[View the full topic](https://community.shopify.com/t/topic/278152)._
