# 注文の確認メールで発送不要商品にもメールを送りたい

**URL:** <https://community.shopify.com/t/topic/415361>\
**Category:** 技術的なQ＆A\
**Tags:** html\
**Created:** [May 21, 2025, 8:43am UTC](https://community.shopify.com/t/topic/415361 "2025-05-21T08:43:56Z")\
**Posts on this page:** 5\
**Page:** 1

## AI-generated summary

配送不要商品（教室申し込みなど）を注文した際、確認メールの本文が空白になる問題が発生していました。

**原因:**
Shopifyのデフォルトコードでは `requires_shipping` が false の場合のメッセージ内容が設定されていないため。既存のコードは `{% if requires_shipping %}` で配送必要な商品のみを処理していました。

**解決方法:**
- `{% if requires_shipping %}` ブロックの後に `{% else %}` 分岐を追加
- 配送不要な商品用の文言を設定
- 具体的には、既存の `{% endcase %}` の後に `{% else %}` ブロックを挿入し、配送不要時のメッセージを記述

質問者は提案された条件分岐を追加することで問題を解決できました。

<div class="post-metadata">

**Author:** ![tcsf2](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@tcsf2](https://community.shopify.com/u/tcsf2)\
**Post date:** [May 21, 2025, 8:43am UTC](https://community.shopify.com/t/topic/415361/1 "2025-05-21T08:43:56Z")

</div>

お客様への通知で「注文の確認」のメールをカスタマイズしているのですが、

配送不要で登録している商品（○○教室の申し込み受付など）が注文された際に文章が全く入っていない確認メールが送られてしまっていることが発覚しました。

このような商品にも配送商品と同じようにメールが送られるようにすることはできないでしょうか？

---

<div class="post-metadata">

**Author:** ![Qcoltd](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/qcoltd/32/900_2.png) [@Qcoltd](https://community.shopify.com/u/Qcoltd)\
**Post date:** [May 22, 2025, 1:09pm UTC](https://community.shopify.com/t/topic/415361/2 "2025-05-22T13:09:40Z")

</div>

@tcsf2 様

カスタマイズしたコードを拝見しないと確実なことは言えないのですが、

配送の要不要は、

```auto
requires_shipping

```

で判定しています。

Shopifyの「注文の確認」のデフォルトコードでは、

上記がfalseになる場合のメッセージ内容が設定されていません。

```markup
{% if requires_shipping %}
// 中略
{% endif %}

```

シンプルに上記のif文とendif文を削除するか、

下記のように条件分岐を追加すると良いのではないかと思います。

```markup
{% if requires_shipping %}
// 配送が必要な注文の場合の文言設定
{% else %}
// 配送が不要な注文の場合の文言設定
{% endif %}

```

ご参考まで。

(キュー田辺)

---

<div class="post-metadata">

**Author:** ![tcsf2](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@tcsf2](https://community.shopify.com/u/tcsf2)\
**Post date:** [May 23, 2025, 1:00am UTC](https://community.shopify.com/t/topic/415361/3 "2025-05-23T01:00:32Z")

</div>

ご返信ありがとうございます！分岐追加したいです。

該当のコードがあることはわかったのですが、どこに入れたらいいか判断できませんでした…

以下のような状況なのですが、どの場所に条件分岐を追加すれば良いでしょうか。

再度お教えいただけますと幸いです。何卒宜しくお願い致します。

■内容詳細■

{% capture email\_title %} {% endcapture %}  
{% capture email\_body %}  
{% if requires\_shipping %}  
{% case delivery\_method %}  
{% when ‘pick-up’ %}  
注文の受取の準備が整うと、メールが届きます。  
{% when ‘local’ %}  
{{ customer.last\_name }}{{ customer.first\_name }}様、ご注文の品を配達する準備を行っております。

{% else %}  
{% if order.transactions[0].gateway == “Bank Deposit” %}  
{{ customer.last\_name }}{{ customer.first\_name }}様  
// 中略（銀行振込の時の案内）

{% else %}  
{{ customer.last\_name }}{{ customer.first\_name }}様

// 中略（銀行振込以外の案内）

{% endif %}  
{% endcase %}

---

<div class="post-metadata">

**Author:** ![Qcoltd](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/qcoltd/32/900_2.png) [@Qcoltd](https://community.shopify.com/u/Qcoltd)\
**Post date:** [May 23, 2025, 4:15am UTC](https://community.shopify.com/t/topic/415361/4 "2025-05-23T04:15:55Z")

</div>

@tcsf2 様

コードの断片からの推測になるので合っているか分かりませんが、下記のようにされると良いかもしれません。

(最後の「ここから追加」を見ていただければ)

```markup
{% capture email_title %} {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
{% case delivery_method %}
{% when 'pick-up' %}
注文の受取の準備が整うと、メールが届きます。
{% when 'local' %}
{{ customer.last_name }}{{ customer.first_name }}様、ご注文の品を配達する準備を行っております。

{% else %}
{% if order.transactions[0].gateway == "Bank Deposit" %}
{{ customer.last_name }}{{ customer.first_name }}様
// 中略（銀行振込の時の案内）

{% else %}
{{ customer.last_name }}{{ customer.first_name }}様

// 中略（銀行振込以外の案内）

 

{% endif %}
{% endcase %}

// ここから追加
{% else %}
// 配送が不要な場合の文言設定

```

ご参考まで。

(キュー田辺)

---

<div class="post-metadata">

**Author:** ![tcsf2](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@tcsf2](https://community.shopify.com/u/tcsf2)\
**Post date:** [May 23, 2025, 5:36am UTC](https://community.shopify.com/t/topic/415361/5 "2025-05-23T05:36:06Z")

</div>

返信ありがとうございます。

教えていただいた通りの箇所に挿入したところ、できました！！！

本当にありがとうございました。
