# カスタムフォームで入力された内容をメールテンプレートに引き継ぐ

**URL:** <https://community.shopify.com/t/topic/43585>\
**Category:** 技術的なQ＆A\
**Created:** [April 18, 2021, 10:53am UTC](https://community.shopify.com/t/topic/43585 "2021-04-18T10:53:04Z")\
**Posts on this page:** 3\
**Page:** 1

## AI-generated summary

商品購入時に追加したカスタムフォームの入力内容を、購入確認メールのテンプレートへ引き継ぎ、条件分岐にも使いたいという質問。想定しているのは、フォームの input の値を取得してメール本文や分岐条件に反映する方法。 

回答では、Shopify の通知メールで使える Liquid 変数を確認し、特に `line_item.properties` が該当する可能性が高いと案内されている。`line_item` は注文内の商品行データ、`properties` は商品ごとの追加入力項目を保持する仕組みで、ここに独自項目を入れればメール表示や条件分岐に利用できる、という整理。 

あわせて、通知メールの変数一覧、メールテンプレートのカスタマイズ解説、商品オプションや line item property の技術記事、フォーラム検索結果へのリンクも共有された。結論としては、カスタムフォームの値は `line_item.properties` などに格納してメールテンプレート側で参照する方向が有力で、具体的な実装は公式ドキュメント参照が推奨されている。

<div class="post-metadata">

**Author:** ![shout\_1](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@shout\_1](https://community.shopify.com/u/shout_1)\
**Post date:** [April 18, 2021, 10:53am UTC](https://community.shopify.com/t/topic/43585/1 "2021-04-18T10:53:04Z")

</div>

お世話になっております。  
カスタムフォームについて、ご質問です。

下記サイトを参考に商品購入時のカスタムフォームを追加しました。

[https://ameblo.jp/yunon1987/entry-12464765458.html](https://ameblo.jp/yunon1987/entry-12464765458.html)

購入時に選択された項目を元に購入確認メールを分岐させたいと思っています。

カスタムフォームで入力された内容をメールテンプレートに引き継ぐために、どのような方法（変数定義など）が考えられますでしょうか。  
inputのnameなどで指定し、valueを取得すればよいかとイメージはつけているのですが…

ご教示いただければ幸いです。よろしくお願いいたします。

---

<div class="post-metadata">

**Author:** ![Jizo\_Inagaki](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jizo_inagaki/32/149480_2.png) [@Jizo\_Inagaki](https://community.shopify.com/u/Jizo_Inagaki)\
**Post date:** [April 23, 2021, 6:55am UTC](https://community.shopify.com/t/topic/43585/2 "2021-04-23T06:55:08Z")

</div>

[https://shopify.dev/docs/themes/liquid/reference/objects/line\_item#line\_item-properties](https://shopify.dev/docs/themes/liquid/reference/objects/line_item#line_item-properties)

[https://help.shopify.com/ja/manual/orders/notifications/email-variables#part-deed74d294eccc84](https://help.shopify.com/ja/manual/orders/notifications/email-variables#part-deed74d294eccc84)

あまり内容を理解できていませんが、恐らく上記のヘルプにある「line\_item.properties」や「line\_item」が該当すると思います。

なお、こういったことはあまり書くべきではないとは思いますが、失礼ながら参考されたサイトは技術系の方が書いているわけではないようですので、以下のような技術系の方が作成された記事を参考にされることをお勧めします。

[https://www.shopify.jp/blog/partner-shopify-theme-customize-cart-attributes-line-item-property-customer-note](https://www.shopify.jp/blog/partner-shopify-theme-customize-cart-attributes-line-item-property-customer-note)

[https://haniwaman.com/shopify-product-option/](https://haniwaman.com/shopify-product-option/)

[https://w3trends.zendesk.com/hc/en-us/articles/115001808432-Edit-your-Confirmation-Email-to-include-Product-Options-](https://w3trends.zendesk.com/hc/en-us/articles/115001808432-Edit-your-Confirmation-Email-to-include-Product-Options-)

また、記載されている内容がわからないということになりましたら、あくまで個人的な見解ではありますが、さらに学ばれるか、業者に依頼されることをお勧めします。  
もちろんアプリを使うのも良いかと思います。

[追記]

フォーラムの検索をお勧めするのを書き忘れていましたので追記します。

[https://community.shopify.com/c/forums/searchpage/tab/message?q=line\_item](https://community.shopify.com/c/forums/searchpage/tab/message?q=line_item)

---

<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 26, 2021, 1:21pm UTC](https://community.shopify.com/t/topic/43585/3 "2021-04-26T13:21:30Z")

</div>

メールカスタマイズは、以下のブログでも解説していますが、

[https://www.shopify.jp/blog/partner-email-template-customize](https://www.shopify.jp/blog/partner-email-template-customize)

その中でリンクされている以下の変数がメールテンプレートで使えるLiquid変数です。

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

例えば、Line\_itemsは、同じくブログで触れられているように、通常のテーマのLine\_itemsと同じデータが参照できるので、ブログで説明されている、Line\_item propertyも参照可能です。

[https://shopify.dev/docs/themes/liquid/reference/objects/line\_item#line\_item-properties](https://shopify.dev/docs/themes/liquid/reference/objects/line_item#line_item-properties)

なので、この項目などに独自項目を入れれば、最終的にメールに反映したり、条件分岐に使うことが可能です。
