# 特定の商品のみ、注文確認メールの文言を分岐

**URL:** <https://community.shopify.com/t/topic/11323>\
**Category:** 技術的なQ＆A\
**Created:** [April 19, 2020, 11:35am UTC](https://community.shopify.com/t/topic/11323 "2020-04-19T11:35:16Z")\
**Posts on this page:** 2\
**Page:** 1

## AI-generated summary

注文確認メールの本文を、購入内容に応じてLiquidで分岐表示したいという技術的な相談。特定の商品が注文に含まれている場合だけ、メール内の文言を変えたいという要件です。

提示された方向性は、注文商品の情報が `line_items` に入っているため、これをループ処理して判定する方法です。商品名や商品IDを条件にして、該当商品が含まれるかどうかで分岐できる可能性があると案内されています。

要点:
- `line_items` を使って注文内の商品一覧を走査する
- 商品名またはIDを条件にLiquidで分岐する
- 参照先はShopifyの通知メール用変数のドキュメント

現時点では、具体的なLiquid構文の完成例までは示されておらず、実装方法の方向性が共有された段階です。議論は未解決で、最終的なコード例や検証結果はまだ出ていません。

<div class="post-metadata">

**Author:** ![myrg0331](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@myrg0331](https://community.shopify.com/u/myrg0331)\
**Post date:** [April 19, 2020, 11:35am UTC](https://community.shopify.com/t/topic/11323/1 "2020-04-19T11:35:16Z")

</div>

注文商品に、ある特定の商品が含まれた場合のみメールの本文を分岐表示したいです。

[https://help.shopify.com/ja/manual/sell-online/notifications/email-variables](https://help.shopify.com/ja/manual/sell-online/notifications/email-variables)

上記URL内の変数を用いてLiquidで分岐するにはどのような構文になりますでしょうか。

---

<div class="post-metadata">

**Author:** ![junichiokamura](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/junichiokamura/32/299737_2.png) [@junichiokamura](https://community.shopify.com/u/junichiokamura)\
**Post date:** [April 20, 2020, 3:13pm UTC](https://community.shopify.com/t/topic/11323/2 "2020-04-20T15:13:34Z")

</div>

購入商品は、{{line\_items}}に含まれるので、これをループして、商品名やIDで処理分岐できると思います。
