# Including Rental Dates in your Shopify Order Confirmation Emails

A customer's rental dates come through on an order as line item properties. By default, Shopify does not include line item properties in it's Order Confirmation email template.

To modify the template, go to Shopify **Settings > Notifications > Customer Notifications > Order confirmation**, then click **Edit Code** at the top right.

Based on the current default template, we recommend including the line item properties between the `selling_plan_allocation` and `refunded_quantity` liquid code for each line item.

The code of the email template is quite complex and outputs slightly different formats for different types of products, so there will usually be multiple parts of the template that need new code added.

The existing code blocks to look for are outlined below. You may find these appear a few times each in your template.

## Code Block 1

Look for the following code, or similar. We recommend doing a search through the template code for `selling_plan_allocation`.

<pre class="language-liquid"><code class="lang-liquid">{% if line.selling_plan_allocation %}
  &#x3C;span class="order-list__item-variant">{{ line.selling_plan_allocation.selling_plan.name }}&#x3C;/span>&#x3C;br/>
<strong>{% endif %}
</strong>
{% if line.refunded_quantity > 0 %}
  &#x3C;span class="order-list__item-refunded">Refunded&#x3C;/span>
{% endif %}
</code></pre>

Each time you see this code, insert the following code between the `selling_plan_allocation` if statement and the `refunded_quantity` if statements (the blank line in the middle of the code above), to output line item properties of the item. This excludes 'hidden' properties that start with an underscore.

```liquid
{% for p in line.properties %}
  {% unless p.last == blank or p.first contains '_' %}
    <p><strong>{{ p.first }}:</strong> {{ p.last }}</p>
  {% endunless %}
{% endfor %}
```

The final result at each code block will look something like this:

```liquid
{% if line.selling_plan_allocation %}
  <span class="order-list__item-variant">{{ line.selling_plan_allocation.selling_plan.name }}</span><br/>
{% endif %}


{% for p in line.properties %}
  {% unless p.last == blank or p.first contains '_' %}
    <p><strong>{{ p.first }}:</strong> {{ p.last }}</p>
  {% endunless %}
{% endfor %}


 {% if line.refunded_quantity > 0 %}
  <span class="order-list__item-refunded">Refunded</span>
 {% endif %}
```

## Code Block 2

Look for the following code, or similar. We recommend doing a search through the template code for `{{component.variant.title}}`&#x20;

```liquid
        {% if component.variant.title != 'Default Title' %}
            <span class="order-list__item-variant">{{ component.variant.title }}</span>
        {% endif %}

        {% if line_item_group.deliverable? %}
            {% if component.discount_allocations %}
                {% for discount_allocation in component.discount_allocations %}
                    {% if discount_allocation.discount_application.target_selection != 'all' %}
                        <p>
                            <span class="order-list__item-discount-allocation">
                            <img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" class="discount-tag-icon" />
                            <span>
                                {{ discount_allocation.discount_application.title | upcase }}
                                (-{{ discount_allocation.amount | money }})
                            </span>
                            </span>
                        </p>
                    {% endif %}
                {% endfor %}
            {% endif %}
        {% endif %}
```

Each time you see this code, insert the following code between the `component.variant.title` if statement and the `line_item_group.deliverable` if statements (the blank line in the middle of the code above), to output line item properties of the item. This excludes 'hidden' properties that start with an underscore.

```liquid
        {% for p in component.properties %}
          {% unless p.last == blank or p.first contains '_' %}
            <p><strong>{{ p.first }}:</strong> {{ p.last }}</p>
          {% endunless %}
        {% endfor %}
```

The final result at each code block will look similar to this:

```liquid
        {% if component.variant.title != 'Default Title' %}
            <span class="order-list__item-variant">{{ component.variant.title }}</span>
        {% endif %}


        {% for p in component.properties %}
          {% unless p.last == blank or p.first contains '_' %}
            <p><strong>{{ p.first }}:</strong> {{ p.last }}</p>
          {% endunless %}
        {% endfor %}


        {% if line_item_group.deliverable? %}
            {% if component.discount_allocations %}
                {% for discount_allocation in component.discount_allocations %}
                    {% if discount_allocation.discount_application.target_selection != 'all' %}
                        <p>
                            <span class="order-list__item-discount-allocation">
                            <img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" class="discount-tag-icon" />
                            <span>
                                {{ discount_allocation.discount_application.title | upcase }}
                                (-{{ discount_allocation.amount | money }})
                            </span>
                            </span>
                        </p>
                    {% endif %}
                {% endfor %}
            {% endif %}
        {% endif %}
```

## Code Block 3

This one usually won't be necessary, but we'll include it anyway, just in case the above aren't working. Look for this in your template:

```liquid
          {% if component.variant.title != 'Default Title' and is_parent == false %}
            <span class="order-list__item-variant">{{ component.variant.title }}</span><br/>
          {% elsif component.variant.title != 'Default Title' and component.nested_line_parent? %}
            <span class="order-list__item-variant">{{ component.variant.title }}</span><br/>
          {% elsif component.variant.title != 'Default Title' and component.bundle_parent? and false == false %}
            <span class="order-list__item-variant">{{ component.variant.title }}</span><br/>
          {% endif %}
```

Add this on a new line directly after it:

```liquid
          {% for p in component.properties %}
            {% unless p.last == blank or p.first contains '_' %}
              <p><strong>{{ p.first }}:</strong> {{ p.last }}</p>
            {% endunless %}
          {% endfor %}
```

{% hint style="danger" %}
Depending on when your store started, and whether previous changes have been made to your order confirmation template, the example code blocks to look for above may or may not be present. In this instance you will need to find the appropriate place(s) to put the code above into your template.
{% endhint %}
