Shipping confirmation e-mail - how to display content for specific shipping method?

Highlighted
New Member
14 0 0

Hey,

I have 2 shipping methods - Home delivery and Collect in store.

I would like to display different content in the shipping confirmation e-mail depending on which of these shipping methods is being used. Does anyone know how to get the shipping method and add a paragraph of text in the e-mail depending on the shipping method?

0 Likes
Highlighted
Pathfinder
112 1 33

Hey there,

You are going to have to edit the HTML of the shipping confirmation email and customize it a bit. I'm assuming you are still using the default email and it has not been changed. I'll guide you through it.

  1. Go to your store admin panel.
  2. Click on the Settings link at the bottom left of the page.
  3. On the next page, click on the blue Notifications link.
  4. On the next page, inside the Shipping window section, click on the Shipping confirmation link.
  5. You should see a text area labeled Email body (HTML). This is the HTML of your notification email. Delete everything in there, and copy and paste the following (I highly recommend backing up the code in this block just in case):
    {% if fulfillment.item_count == item_count %} 
      {% capture shipment_name %}Your order is{% endcapture %}
    {% elsif fulfillment.item_count > 1 %} 
      {% if fulfillment_status == 'fulfilled' %}
        {% capture shipment_name %}The last items in your order are{% endcapture %}
      {% else %}
        {% capture shipment_name %}Some items in your order are{% endcapture %}
      {% endif %}
    {% else %} 
      {% if fulfillment_status == 'fulfilled' %}
        {% capture shipment_name %}The last item in your order is{% endcapture %}
      {% else %}
        {% capture shipment_name %}One item in your order is{% endcapture %}
      {% endif %}
    {% endif %}
    
    {% capture email_title %}{{ shipment_name }} on the way{% endcapture %}
    {% capture email_body %}{{ shipment_name }} on the way to you. Track your shipment to see the delivery status.{% endcapture %}
    {% capture email_emphasis %}Estimated delivery date: <strong>{{fulfillment.estimated_delivery_at | date: "%B %d, %Y"}}</strong>{% endcapture %}
    
    {% if shipping_method.title == 'Home delivery' %}
      {% capture shipping_method_information %}This is the text that will show up for the home delivery shipping method.{% endcapture %}
    {% else %}
      {% capture shipping_method_information %}This is the text that will show up for the collect in store shipping method.{% endcapture %}
    {% endif %}
    
    <!DOCTYPE html>
    <html lang="en">
      <head>
      <title>{{ email_title }}</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="viewport" content="width=device-width">
      <link rel="stylesheet" type="text/css" href="/assets/notifications/styles.css">
      <style>
        .button__cell { background: {{ shop.email_accent_color }}; }
        a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
      </style>
    </head>
    
      <body>
    
        <table class="body">
          <tr>
            <td>
              <table class="header row">
      <tr>
        <td class="header__cell">
          <center>
    
            <table class="container">
              <tr>
                <td>
    
                  <table class="row">
                    <tr>
                      <td class="shop-name__cell">
                        {%- if shop.email_logo_url %}
                          <img src="{{shop.email_logo_url}}" alt="{{ shop.name }}" width="{{ shop.email_logo_width }}">
                        {%- else %}
                          <h1 class="shop-name__text">
                            <a href="{{shop.url}}">{{ shop.name }}</a>
                          </h1>
                        {%- endif %}
                      </td>
    
                        <td class="order-number__cell">
                          <span class="order-number__text">
                            Order {{ order_name }}
                          </span>
                        </td>
                    </tr>
                  </table>
    
                </td>
              </tr>
            </table>
    
          </center>
        </td>
      </tr>
    </table>
    
              <table class="row content">
      <tr>
        <td class="content__cell">
          <center>
            <table class="container">
              <tr>
                <td>
                  
                <h2>{{ email_title }}</h2>
                <p>{{ email_body }}</p>
                <p>{{ shipping_method_information }}</p>
                {% if fulfillment.estimated_delivery_at %}
                  <p>{{ email_emphasis }}</p>
                {% endif %}
                {% if order_status_url %}
                  <table class="row actions">
      <tr>
        <td class="actions__cell">
          <table class="button main-action-cell">
            <tr>
              <td class="button__cell"><a href="{{ order_status_url }}" class="button__text">View your order</a></td>
            </tr>
          </table>
          {% if shop.url %}
        <table class="link secondary-action-cell">
          <tr>
            <td class="link__cell"><a href="{{ shop.url }}" class="link__text"><span class='or'>or</span> Visit our store</a></td>
          </tr>
        </table>
    {% endif %}
    
        </td>
      </tr>
    </table>
    
                {% else %}
                  {% if shop.url %}
        <table class="row actions">
          <tr>
            <td class="actions__cell">
              <table class="button main-action-cell">
                <tr>
                  <td class="button__cell"><a href="{{ shop.url }}" class="button__text">Visit our store</a></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
    {% endif %}
    
                {% endif %}
    
                </td>
              </tr>
            </table>
          </center>
        </td>
      </tr>
    </table>
    
              <table class="row section">
      <tr>
        <td class="section__cell">
          <center>
            <table class="container">
              <tr>
                <td>
                  <h3>Items in this shipment</h3>
                </td>
              </tr>
            </table>
            <table class="container">
              <tr>
                <td>
                  
                
    <table class="row">
      {% for line in fulfillment.fulfillment_line_items %}
      <tr class="order-list__item">
        <td class="order-list__item__cell">
          <table>
            <td>
              {% if line.line_item.image %}
                <img src="{{ line.line_item | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
              {% endif %}
            </td>
            <td class="order-list__product-description-cell">
              {% if line.line_item.product.title %}
                {% assign line_title = line.line_item.product.title %}
              {% else %}
                {% assign line_title = line.line_item.title %}
              {% endif %}
    
              {% if line.quantity < line.line_item.quantity %}
                {% capture line_display %} {{ line.quantity }} of {{ line.line_item.quantity }} {% endcapture %}
              {% else %}
                {% assign line_display = line.line_item.quantity  %}
              {% endif %}
    
              <span class="order-list__item-title">{{ line_title }} × {{ line_display }}</span><br/>
    
              {% if line.line_item.variant.title != 'Default Title' %}
                <span class="order-list__item-variant">{{ line.line_item.variant.title }}</span>
              {% endif %}
            </td>
          </table>
        </td>
      </tr>{% endfor %}
    </table>
    
    
                </td>
              </tr>
            </table>
          </center>
        </td>
      </tr>
    </table>
    
              <table class="row footer">
      <tr>
        <td class="footer__cell">
          <center>
            <table class="container">
              <tr>
                <td>
                  <p class="disclaimer__subtext">If you have any questions, reply to this email or contact us at <a href="mailto:{{ shop.email }}">{{ shop.email }}</a></p>
                </td>
              </tr>
            </table>
          </center>
        </td>
      </tr>
    </table>
    
    <img src="{{ 'notifications/spacer.png' | shopify_asset_url }}" class="spacer" height="1" />
    
            </td>
          </tr>
        </table>
      </body>
    </html>
    

    You may have to edit this specific line near the top, and change the name to exactly match the label of the 'Home delivery' shipping method:

    {% if shipping_method.title == 'Home delivery' %}

    Right under that shipping_method.title code, you will see text that says This is the text that will show up for the home delivery shipping method. and This is the text that will show up for the collect in store shipping method. in between {% capture %} tags. Edit this text to whatever you wish to display to customers.

  6. Don't forget to test send emails and preview them using the buttons below the Shipping confirmation title at the top of the page.

  7. Click on the blue Save button when you are done.

That should be all you have to do. Let me know if that works.

The easiest way to get Shopify help. Submit your task, get a quote, and we'll get the work done. Work with me at shupkeep.com
1 Like
Highlighted
New Member
14 0 0

Thanks Alex, finally tried this and it worked like a charm! Appreciate it!

0 Likes
Highlighted
New Member
1 0 0

I have a similar problem. We do a Standard shipping, will call, and local drop off. I am wanting to include in the Will Call notification, a reminder for customers to schedule a pick up, but the standard shipping can be left normal. Is what I did below correct? Do I need to write/change anything for the standard shipping? 

 

{% if shipping_method.title == ‘Will Call %}
{% capture shipping_method_information %} We're excited you have chosen to pick up your item at Katie's San Francisco Shop. Your order is ready, please contact us to schedule a pick up time.{% endcapture %}
{% else %}
{% capture shipping_method_information %} This is the text that will show up for the standard shipping method. {% endcapture %}
{% endif %}

0 Likes
Highlighted
New Member
1 0 0

Hi! How do I do this for more than one shipping type? For example we have "curbside Pick up", "local delivery", "Mail Gift Card USPS"

0 Likes
Highlighted
New Member
1 0 0

Are you still availble to help with this coding?

 

I can't figure out why none of the text is showing up on my emails.

0 Likes