# 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 anywhere that the `variant.title` is output within the template.

Unfortunately, the code of the email template is quite complex and outputs slightly different formats for different types of products, so there will usually be quite a few parts of the template that need new code added to cover all scenarios.

We recommend searching the template for all outputs of `variant.title` . For Example:

```liquid
          <span class="order-list__item-title">{{ line_title }}&nbsp;&times;&nbsp;{{ line_display }}</span><br/>

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

          {% if false %}
            {% for child_line in line.bundle_components %}
```

In this code, `variant.title` is being displayed, with some conditions that determine how it should be displayed.

Beneath this, we want to output the item's line item properties, which includes the rental dates, delivery method and any custom field data you may have attached.

The code to output all properties, excluding hidden properties (anything that starts with an underscore) is:

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

If you only want to output specific properties by name, you could use something like this:

```liquid
{% for p in line.properties %}
  {% if p.first == 'Delivery Date' and p.last != blank %}
    <p>{{ p.first }}: {{ p.last }}</p>
  {% elsif p.first == 'Return Date' and p.last != blank %}
    <p>{{ p.first }}: {{ p.last }}</p>
  {% endif %}
{% endfor %}  
```

This would only output the `Delivery Date` and `Return Date` properties, if that's how they've been named in your Rental Settings.

Coming back to the example earlier, I would paste in the code after the block that outputs the variant.title, like so:

```liquid
          <span class="order-list__item-title">{{ line_title }}&nbsp;&times;&nbsp;{{ line_display }}</span><br/>

          {% if line.variant.title != 'Default Title' and is_parent == false %}
            <span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
          {% elsif line.variant.title != 'Default Title' and line.nested_line_parent? %}
            <span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
          {% elsif line.variant.title != 'Default Title' and line.bundle_parent? and false == false %}
            <span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
          {% endif %}      
          
          
          {% for p in line.properties %}
            {% unless p.last == blank or p.first contains '_' %}
              <p>{{ p.first }}: {{ p.last }}</p>
            {% endunless %}
          {% endfor %}    
          

          {% if false %}
            {% for child_line in line.bundle_components %}
```

{% hint style="warning" %}
**IMPORTANT**\
\
Note that above the first line of the pasted code is:\
\
&#x20;         {% for p in **line**.properties %}\
\
Because in the code just above you can see that variant.title is output by using **line.**&#x76;ariant.title.

In other parts of the code, it may be using **child\_line.**&#x76;ariant.title, or **component.**&#x76;ariant.title. In these spots you need to replace **line** with **child\_line** or **component** in the first line of the code pasted in.
{% endhint %}

If you're finding it's just too difficult, or it's not working as expected, please just feel free to [contact us](https://tally.so/r/mVlWGy) and we can do it for you. We'll need collaborator access to your store and we can make the request for your approval once your support enquiry comes in.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.productrentalspro.com/user-guide/other/improving-the-cart-and-checkout-experience/including-rental-dates-in-your-shopify-order-confirmation-emails.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
