Support

Customize Shopify's native email and SMS notifications

Updated on March 23, 2021

If you’d prefer to use Shopify’s native email and SMS notifications instead of Alpaca, then you’ll need to add some liquid code to your notification templates in the Shopify admin.

Before you start

We recommend disabling notifications within Alpaca if you want to use Shopify’s notifications instead. This will ensure that your customers don’t receive multiple notifications for the same event.


Notification: Order confirmation

This notification is sent to customers after they’ve placed an order.

Email

  1. Navigate to the Settings section of your Shopify admin.
  2. Select the Notifications section.
  3. Select the Order confirmation notification, and add the following code snippet to the Email template.

{% comment %}
  Change these options to customize how your emails are formatted:
  - alpaca_show_scheduled_time_range_pickups: Change this to true if you want to show time ranges for pickups (default is false)
  - alpaca_pickup_increment_minutes: Change this to the time range (in minutes) that you offer for pickups (default is 60)
  - alpaca_show_scheduled_time_range_deliveries: Change this to true if you want to show time ranges for deliveries (default is false)
  - alpaca_delivery_increment_minutes: Change this to the time range (in minutes) that you offer for deliveries (default is 120)
{% endcomment %}
{% assign alpaca_show_scheduled_time_range_pickups = false %}
{% assign alpaca_pickup_increment_minutes = 60 %}
{% assign alpaca_show_scheduled_time_range_deliveries = false %}
{% assign alpaca_delivery_increment_minutes = 120 %}

{% comment %}
  Change date formats. Learn what options you can use: https://help.looker.com/hc/en-us/articles/360023800253-Easy-Date-Formatting-with-Liquid
{% endcomment %}
{% assign alpaca_date_format_no_range = "%A %B %d at %l:%M %P" %}
{% assign alpaca_date_format_range_start = "%A %B %d from %l:%M %P" %}
{% assign alpaca_date_format_range_end = " to %l:%M %P" %}

{% comment %}
  Don't change anything below here, unless you know what you're doing
{% endcomment %}
{% assign alpaca_delivery_method = delivery_method %}
{% assign alpaca_scheduled_time_expected = false %}
{% assign alpaca_scheduled_time = nil %}
{% assign alpaca_line_item_property = nil %}
{% for line_item in line_items %}
  {% if line_item.properties %}
    {% for property in line_item.properties %}
      {% assign alpaca_name = property | first %}
      {% if alpaca_name == '_alpaca_id' %}
        {% assign alpaca_line_item_property = property | last %}
      {% endif %}
    {% endfor %}
  {% endif %}
{% endfor %}

{% if alpaca_line_item_property %}
  {% assign alpaca_timezone_offset_hours = "now" | date:"%z" | slice: 0, 3 | times: 3600 %}
  {% assign alpaca_timezone_offset_minutes = "now" | date:"%z" | slice: 3, 4 | times: 60 %}
  {% assign alpaca_timezone_offset = alpaca_timezone_offset_hours | plus: alpaca_timezone_offset_minutes %}
  {% assign alpaca_line_item_property_parts = alpaca_line_item_property | split:"|" %}
  {% assign alpaca_type = alpaca_line_item_property_parts[2] %}
  {% assign alpaca_rate_or_schedule_id = alpaca_line_item_property_parts[1] %}
  {% assign alpaca_line_item_property_timestamp = alpaca_line_item_property_parts | first | divided_by: 1000 %}
  {% if alpaca_line_item_property_parts[0] != 'notimestamp' %}{% assign alpaca_scheduled_time_expected = true %}{% endif %}
  {% if alpaca_type == 'p' and alpaca_pickup_increment_minutes %}
    {% assign alpaca_pickup_increment_seconds = alpaca_pickup_increment_minutes | times:60 %}
    {% assign alpaca_scheduled_range_end_formatted = alpaca_line_item_property_timestamp | plus: alpaca_pickup_increment_seconds | minus: alpaca_timezone_offset  | date: alpaca_date_format_range_end %}
    {% if alpaca_show_scheduled_time_range_pickups %}
      {% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_range_start | append: alpaca_scheduled_range_end_formatted %}
    {% else %}
      {% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_no_range %}
    {% endif %}
  {% elsif alpaca_type == 'd' and alpaca_delivery_increment_minutes %}
    {% assign alpaca_delivery_increment_seconds = alpaca_delivery_increment_minutes | times:60 %}
    {% assign alpaca_scheduled_range_end_formatted = alpaca_line_item_property_timestamp | plus: alpaca_delivery_increment_seconds | minus: alpaca_timezone_offset | date: alpaca_date_format_range_end %}
    {% if alpaca_show_scheduled_time_range_deliveries %}
      {% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_range_start | append: alpaca_scheduled_range_end_formatted %}
    {% else %}
      {% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_no_range %}
    {% endif %}
  {% else %}
    {% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_no_range %}
  {% endif %}
{% endif %}

{% for method in shipping_methods %}
  {% if method.handle contains "alpaca:pickup" %}
    {% assign alpaca_delivery_method = "pick-up" %}
  {% elsif method.handle contains "alpaca:delivery" %}
    {% assign alpaca_delivery_method = "local" %}
  {% endif %}
  {% if method.handle contains "alpaca:" %}
    {% if method.handle contains ":scheduled" %}
      {% assign alpaca_scheduled_time_expected = true %}
    {% else %}
      {% assign alpaca_scheduled_time_expected = false %}
    {% endif %}
  {% endif %}
{% endfor %}

{% capture email_title %}Thank you for your purchase! {% endcapture %}
{% capture email_body %}
  {% if requires_shipping %}
    {% case alpaca_delivery_method %}
      {% when 'pick-up' %}
        {% if alpaca_scheduled_time_expected %}
          {% if alpaca_scheduled_time %}
            Hi {{ customer.first_name }}, your order will be ready for pickup on {{ alpaca_scheduled_time }}.
          {% else %}
            Hi {{ customer.first_name }}, please <a href="{{ order_status_url }}">schedule a pickup time</a> for your order.
          {% endif %}
        {% else %}
          Hi {{ customer.first_name }}, you’ll receive an email when your order is ready for pickup.
        {% endif %}
      {% when 'local' %}
        {% if alpaca_scheduled_time_expected %}
          {% if alpaca_scheduled_time %}
            Hi {{ customer.first_name }}, your order will be delivered on {{ alpaca_scheduled_time }}.
          {% else %}
            Hi {{ customer.first_name }}, please <a href="{{ order_status_url }}">schedule a delivery time</a> for your order.
          {% endif %}
        {% else %}
          Hi {{ customer.first_name }}, we're getting your order ready for delivery.
        {% endif %}
      {% else %}
        Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent.
    {% endcase %}
    {% if delivery_instructions != blank  %}
      <p><b>Delivery information:</b> {{ delivery_instructions }}</p>
    {% endif %}
  {% endif %}
{% endcapture %}

<!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>
            {% if order_status_url %}
              <table class="row actions">
  <tr>
    <td class="empty-line">Â </td>
  </tr>
  <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">or <a href="{{ shop.url }}">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>

          {% assign gift_card_line_item = line_items | where: "gift_card" %}
          {% if gift_card_line_item.first %}
            <table class="row section">
  <tr>
    <td class="section__cell">
      <center>
        <table class="container">
          <tr>
            <td>
              <h3>Gift card</h3>
            </td>
          </tr>
        </table>
        <table class="container">
          <tr>
            <td>

              <p> You’ll receive separate emails for any gift cards.</p>

            </td>
          </tr>
        </table>
      </center>
    </td>
  </tr>
</table>
          {% endif %}

          <table class="row section">
  <tr>
    <td class="section__cell">
      <center>
        <table class="container">
          <tr>
            <td>
              <h3>Order summary</h3>
            </td>
          </tr>
        </table>
        <table class="container">
          <tr>
            <td>


<table class="row">
  {% for line in subtotal_line_items %}
  <tr class="order-list__item">
    <td class="order-list__item__cell">
      <table>
        <td>
          {% if line.image %}
            <img src="{{ line | 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.product.title %}
            {% assign line_title = line.product.title %}
          {% else %}
            {% assign line_title = line.title %}
          {% endif %}

          {% if line.quantity < line.quantity %}
            {% capture line_display %} {{ line.quantity }} of {{ line.quantity }} {% endcapture %}
          {% else %}
            {% assign line_display = line.quantity  %}
          {% endif %}

          <span class="order-list__item-title">{{ line_title }} × {{ line_display }}</span><br/>

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

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

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

          {% if line.discount_allocations %}
            {% for discount_allocation in line.discount_allocations %}
              {% if discount_allocation.discount_application.target_selection != 'all' %}
                <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>
              {% endif %}
            {% endfor %}
          {% endif %}
        </td>
          <td class="order-list__price-cell">
            {% if line.original_line_price != line.final_line_price %}
              <del class="order-list__item-original-price">{{ line.original_line_price | money }}</del>
            {% endif %}
            <p class="order-list__item-price">
              {% if line.final_line_price > 0 %}
                {{ line.final_line_price | money }}
              {% else %}
                Free
              {% endif %}
            </p>
          </td>
      </table>
    </td>
  </tr>{% endfor %}
</table>

            <table class="row subtotal-lines">
  <tr>
    <td class="subtotal-spacer"></td>
    <td>
      <table class="row subtotal-table">
        {% for discount_application in discount_applications %}
          {% if discount_application.target_selection == 'all' %}
            {% capture discount_title %}
              {% if discount_application.title %}
                {{ discount_application.title | upcase }}
              {% else %}
                Discount
              {% endif %}
            {% endcapture %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Discount</span>
        <span class="subtotal-line__discount">
          <img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" class="discount-tag-icon" />
          <span class="subtotal-line__discount-title">{{ discount_title }}</span>
        </span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>-{{ discount_application.total_allocated_amount | money }}</strong>
  </td>
</tr>

          {% endif %}
        {% endfor %}


<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Subtotal</span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>{{ subtotal_price | money }}</strong>
  </td>
</tr>

        {% if delivery_method == 'pick-up' %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Pickup</span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>{{ shipping_price | money }}</strong>
  </td>
</tr>

        {% else %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Shipping</span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>{{ shipping_price | money }}</strong>
  </td>
</tr>

        {% endif %}

        {% if current_total_duties %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Duties</span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>{{ current_total_duties | money }}</strong>
  </td>
</tr>

        {% endif %}


<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Taxes</span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>{{ tax_price | money }}</strong>
  </td>
</tr>


        {% if total_tip and total_tip > 0 %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Tip</span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>{{ total_tip | money }}</strong>
  </td>
</tr>

        {% endif %}
      </table>
      <table class="row subtotal-table subtotal-table--total">

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Total</span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>{{ total_price | money_with_currency }}</strong>
  </td>
</tr>

      </table>

      {% if total_discounts > 0 %}
        <p class="total-discount">
          You saved <span class="total-discount--amount">{{ total_discounts | money }}</span>
        </p>
      {% endif %}

      {% assign transaction_size = 0 %}
      {% assign transaction_amount = 0 %}
      {% for transaction in transactions %}
        {% unless transaction.kind == "capture" or transaction.kind == "void" %}
          {% assign transaction_size = transaction_size | plus: 1 %}
          {% assign transaction_amount = transaction_amount | plus: transaction.amount %}
        {% endunless %}
      {% endfor %}

      {% if transaction_size > 1 or transaction_amount < total_price %}
        <table class="row subtotal-table">
          <tr><td colspan="2" class="subtotal-table__line"></td></tr>
          <tr><td colspan="2" class="subtotal-table__small-space"></td></tr>

          {% for transaction in transactions %}
            {% if transaction.status == "success" and transaction.kind == "authorization" or transaction.kind == "sale" %}
              {% if transaction.payment_details.credit_card_company %}
                {% capture transaction_name %}{{ transaction.payment_details.credit_card_company }} (ending in {{ transaction.payment_details.credit_card_last_four_digits }}){% endcapture %}
              {% else %}
                {% capture transaction_name %}{{ transaction.gateway_display_name }}{% endcapture %}
              {% endif %}


<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>{{transaction_name}}</span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>{{ transaction.amount | money }}</strong>
  </td>
</tr>

            {% endif %}
            {% if transaction.kind == 'refund' %}
              {% if transaction.payment_details.credit_card_company %}
                {% assign refund_method_title = transaction.payment_details.credit_card_company %}
              {% else %}
                {% assign refund_method_title = transaction.gateway %}
              {% endif %}


<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Refund</span>
        <br>
        <small>{{ refund_method_title | capitalize }}</small>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>- {{ transaction.amount | money }}</strong>
  </td>
</tr>

            {% endif %}
          {% endfor %}
        </table>
      {% endif %}
    </td>
  </tr>
</table>


            </td>
          </tr>
        </table>
      </center>
    </td>
  </tr>
</table>

          <table class="row section">
  <tr>
    <td class="section__cell">
      <center>
        <table class="container">
          <tr>
            <td>
              <h3>Customer information</h3>
            </td>
          </tr>
        </table>
        <table class="container">
          <tr>
            <td>

            <table class="row">
              <tr>
                {% if requires_shipping and shipping_address %}
                <td class="customer-info__item">
                  <h4>Shipping address</h4>
                  {{ shipping_address | format_address }}
                </td>
                {% endif %}
                {% if billing_address %}
                <td class="customer-info__item">
                  <h4>Billing address</h4>
                  {{ billing_address | format_address }}
                </td>
                {% endif %}
              </tr>
            </table>
            <table class="row">
              <tr>
                {% if requires_shipping and shipping_address %}
                <td class="customer-info__item">
                  <h4>Shipping method</h4>
                  <p>{{ shipping_method.title }}</p>
                </td>
                {% endif %}
                {% assign transaction_count = transactions | size %}
                {% if transaction_count > 0 %}
                <td class="customer-info__item">
                  <h4>Payment method</h4>
                  {% for transaction in transactions %}
                    {% if transaction.status == "success" or transaction.status == "pending" %}
                      {% if transaction.kind == "authorization" or transaction.kind == "sale" %}
                        {% if transaction.payment_details.credit_card_company %}
                            <p class="customer-info__item-content">
                              <img src="{{ transaction.payment_details.credit_card_company | payment_icon_png_url  }}" class="customer-info__item-credit" height="24" alt="{{ transaction.payment_details.credit_card_company }}">
                              <span>ending with {{ transaction.payment_details.credit_card_last_four_digits }} — <strong>{{ transaction.amount | money }}</strong></span>
                            </p>
                          {% elsif transaction.gateway_display_name == "Gift card" %}
                          <p class="customer-info__item-content">
                            <img src="{{ transaction.gateway_display_name | downcase | replace: ' ', '-'  | payment_type_img_url }}" class="customer-info__item-credit" height="24">
                          ending with {{ transaction.payment_details.gift_card.last_four_characters | upcase }} — <strong>{{ transaction.amount | money }}</strong> <br />
                                Gift card balance: {{ transaction.payment_details.gift_card.balance |  money }}
                          </p>
                          {% else %}
                              <p class="customer-info__item-content">
                              {{ transaction.gateway_display_name }} — <strong>{{ transaction.amount | money }}</strong>
                              </p>
                          {% endif %}
                  {% endif %}
                    {% endif %}
                  {% endfor %}
                </td>
                {% endif %}
              </tr>
            </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>

SMS

  1. Navigate to the Settings section of your Shopify admin.
  2. Select the Notifications section.
  3. Select the Order confirmation notification, and add the following code snippet to the SMS template.

{% assign alpaca_show_scheduled_time_range_pickups = false %}{% assign alpaca_pickup_increment_minutes = 60 %}{% assign alpaca_show_scheduled_time_range_deliveries = false %}{% assign alpaca_delivery_increment_minutes = 120 %}{% assign alpaca_date_format_no_range = "%A %B %d at %l:%M %P" %}{% assign alpaca_date_format_range_start = "%A %B %d from %l:%M %P" %}{% assign alpaca_date_format_range_end = " to %l:%M %P" %}{% assign alpaca_delivery_method = delivery_method %}{% assign alpaca_scheduled_time_expected = false %}{% assign alpaca_scheduled_time = nil %}{% assign alpaca_line_item_property = nil %}{% for line_item in order.line_items %}{% if line_item.properties %}{% for property in line_item.properties %}{% assign alpaca_name = property | first %}{% if alpaca_name == '_alpaca_id' %}{% assign alpaca_line_item_property = property | last %}{% endif %}{% endfor %}{% endif %}{% endfor %}{% if alpaca_line_item_property %}{% assign alpaca_timezone_offset_hours = "now" | date:"%z" | slice: 0, 3 | times: 3600 %}{% assign alpaca_timezone_offset_minutes = "now" | date:"%z" | slice: 3, 4 | times: 60 %}{% assign alpaca_timezone_offset = alpaca_timezone_offset_hours | plus: alpaca_timezone_offset_minutes %}{% assign alpaca_line_item_property_parts = alpaca_line_item_property | split:"|" %}{% assign alpaca_type = alpaca_line_item_property_parts[2] %}{% assign alpaca_rate_or_schedule_id = alpaca_line_item_property_parts[1] %}{% assign alpaca_line_item_property_timestamp = alpaca_line_item_property_parts | first | divided_by: 1000 %}{% if alpaca_line_item_property_parts[0] != 'notimestamp' %}{% assign alpaca_scheduled_time_expected = true %}{% endif %}{% if alpaca_type == 'p' and alpaca_pickup_increment_minutes %}{% assign alpaca_pickup_increment_seconds = alpaca_pickup_increment_minutes | times:60 %}{% assign alpaca_scheduled_range_end_formatted = alpaca_line_item_property_timestamp | plus: alpaca_pickup_increment_seconds | minus: alpaca_timezone_offset  | date: alpaca_date_format_range_end %}{% if alpaca_show_scheduled_time_range_pickups %}{% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_range_start | append: alpaca_scheduled_range_end_formatted %}{% else %}{% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_no_range %}{% endif %}{% elsif alpaca_type == 'd' and alpaca_delivery_increment_minutes %}{% assign alpaca_delivery_increment_seconds = alpaca_delivery_increment_minutes | times:60 %}{% assign alpaca_scheduled_range_end_formatted = alpaca_line_item_property_timestamp | plus: alpaca_delivery_increment_seconds | minus: alpaca_timezone_offset | date: alpaca_date_format_range_end %}{% if alpaca_show_scheduled_time_range_deliveries %}{% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_range_start | append: alpaca_scheduled_range_end_formatted %}{% else %}{% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_no_range %}{% endif %}{% else %}{% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_no_range %}{% endif %}{% endif %}{% for method in order.shipping_methods %}{% if method.handle contains "alpaca:pickup" %}{% assign alpaca_delivery_method = "pick-up" %}{% elsif method.handle contains "alpaca:delivery" %}{% assign alpaca_delivery_method = "local" %}{% endif %}{% if method.handle contains "alpaca:" %}{% if method.handle contains ":scheduled" %}{% assign alpaca_scheduled_time_expected = true %}{% else %}{% assign alpaca_scheduled_time_expected = false %}{% endif %}{% endif %}{% endfor %}Hi{% unless order.customer.first_name == blank %} {{ order.customer.first_name }}{% endunless %}, thanks for your purchase of {{ order.total_price | money }} from {{shop.name}}! {% if order.requires_shipping %}{% case alpaca_delivery_method %}{% when 'pick-up' %}{% if alpaca_scheduled_time_expected %}{% if alpaca_scheduled_time %}Your order will be ready for pickup on {{ alpaca_scheduled_time }}.{% else %}Please schedule a pickup time for your order: {{ order_status_url }}{% endif %}{% else %}You’ll receive an email when your order is ready for pickup.{% endif %}{% when 'local' %}{% if alpaca_scheduled_time_expected %}{% if alpaca_scheduled_time %}Your order will be delivered on {{ alpaca_scheduled_time }}.{% else %}Please schedule a delivery time for your order: {{ order_status_url }}{% endif %}{% else %}We're getting your order ready for delivery.{% endif %}{% else %}We're getting your order ready to be shipped. We will notify you when it has been sent.{% endcase %}{% if delivery_instructions != blank  %}Delivery information: {{ delivery_instructions }}{% endif %}{% endif %}{% if order.order_status_url %} View order ({{ order.name }}): {{ order.order_status_url }}{% endif %}

Text {{ 'stop' | upcase }} to unsubscribe.

Notification: New order

This notification is sent internally when you receive a new order.

Email

  1. Navigate to the Settings section of your Shopify admin.
  2. Select the Notifications section.
  3. Select the New order notification, and add the following code snippet to the Email template.

{% comment %}
  Change these options to customize how your emails are formatted:
  - alpaca_show_scheduled_time_range_pickups: Change this to true if you want to show time ranges for pickups (default is false)
  - alpaca_pickup_increment_minutes: Change this to the time range (in minutes) that you offer for pickups (default is 60)
  - alpaca_show_scheduled_time_range_deliveries: Change this to true if you want to show time ranges for deliveries (default is false)
  - alpaca_delivery_increment_minutes: Change this to the time range (in minutes) that you offer for deliveries (default is 120)
{% endcomment %}
{% assign alpaca_show_scheduled_time_range_pickups = false %}
{% assign alpaca_pickup_increment_minutes = 60 %}
{% assign alpaca_show_scheduled_time_range_deliveries = false %}
{% assign alpaca_delivery_increment_minutes = 120 %}

{% comment %}
  Change date formats. Learn what options you can use: https://help.looker.com/hc/en-us/articles/360023800253-Easy-Date-Formatting-with-Liquid
{% endcomment %}
{% assign alpaca_date_format_no_range = "%A %B %d at %l:%M %P" %}
{% assign alpaca_date_format_range_start = "%A %B %d from %l:%M %P" %}
{% assign alpaca_date_format_range_end = " to %l:%M %P" %}

{% comment %}
  Don't change anything below here, unless you know what you're doing
{% endcomment %}
{% assign alpaca_delivery_method = delivery_method %}
{% assign alpaca_scheduled_time_expected = false %}
{% assign alpaca_scheduled_time = nil %}
{% assign alpaca_line_item_property = nil %}
{% for line_item in line_items %}
  {% if line_item.properties %}
    {% for property in line_item.properties %}
      {% assign alpaca_name = property | first %}
      {% if alpaca_name == '_alpaca_id' %}
        {% assign alpaca_line_item_property = property | last %}
      {% endif %}
    {% endfor %}
  {% endif %}
{% endfor %}

{% if alpaca_line_item_property %}
  {% assign alpaca_timezone_offset_hours = "now" | date:"%z" | slice: 0, 3 | times: 3600 %}
  {% assign alpaca_timezone_offset_minutes = "now" | date:"%z" | slice: 3, 4 | times: 60 %}
  {% assign alpaca_timezone_offset = alpaca_timezone_offset_hours | plus: alpaca_timezone_offset_minutes %}
  {% assign alpaca_line_item_property_parts = alpaca_line_item_property | split:"|" %}
  {% assign alpaca_type = alpaca_line_item_property_parts[2] %}
  {% assign alpaca_rate_or_schedule_id = alpaca_line_item_property_parts[1] %}
  {% assign alpaca_line_item_property_timestamp = alpaca_line_item_property_parts | first | divided_by: 1000 %}
  {% if alpaca_line_item_property_parts[0] != 'notimestamp' %}{% assign alpaca_scheduled_time_expected = true %}{% endif %}
  {% if alpaca_type == 'p' and alpaca_pickup_increment_minutes %}
    {% assign alpaca_pickup_increment_seconds = alpaca_pickup_increment_minutes | times:60 %}
    {% assign alpaca_scheduled_range_end_formatted = alpaca_line_item_property_timestamp | plus: alpaca_pickup_increment_seconds | minus: alpaca_timezone_offset  | date: alpaca_date_format_range_end %}
    {% if alpaca_show_scheduled_time_range_pickups %}
      {% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_range_start | append: alpaca_scheduled_range_end_formatted %}
    {% else %}
      {% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_no_range %}
    {% endif %}
  {% elsif alpaca_type == 'd' and alpaca_delivery_increment_minutes %}
    {% assign alpaca_delivery_increment_seconds = alpaca_delivery_increment_minutes | times:60 %}
    {% assign alpaca_scheduled_range_end_formatted = alpaca_line_item_property_timestamp | plus: alpaca_delivery_increment_seconds | minus: alpaca_timezone_offset | date: alpaca_date_format_range_end %}
    {% if alpaca_show_scheduled_time_range_deliveries %}
      {% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_range_start | append: alpaca_scheduled_range_end_formatted %}
    {% else %}
      {% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_no_range %}
    {% endif %}
  {% else %}
    {% assign alpaca_scheduled_time = alpaca_line_item_property_timestamp | minus: alpaca_timezone_offset | date: alpaca_date_format_no_range %}
  {% endif %}
{% endif %}

{% for method in shipping_methods %}
  {% if method.handle contains "alpaca:pickup" %}
    {% assign alpaca_delivery_method = "pick-up" %}
  {% elsif method.handle contains "alpaca:delivery" %}
    {% assign alpaca_delivery_method = "local" %}
  {% endif %}
  {% if method.handle contains "alpaca:" %}
    {% if method.handle contains ":scheduled" %}
      {% assign alpaca_scheduled_time_expected = true %}
    {% else %}
      {% assign alpaca_scheduled_time_expected = false %}
    {% endif %}
  {% endif %}
{% endfor %}

{% capture alpaca_delivery_method_details %}
  {% if requires_shipping %}
    {% case alpaca_delivery_method %}
      {% when 'pick-up' %}
        {% if alpaca_scheduled_time_expected %}
          {% if alpaca_scheduled_time %}
            Pickup time: {{ alpaca_scheduled_time }}
          {% else %}
            Pickup time: Not scheduled (at time of order)
          {% endif %}
        {% else %}
          Notify customer when order is ready
        {% endif %}
      {% when 'local' %}
        {% if alpaca_scheduled_time_expected %}
          {% if alpaca_scheduled_time %}
            Delivery time: {{ alpaca_scheduled_time }}
          {% else %}
            Delivery time: Not scheduled (at time of order)
          {% endif %}
        {% else %}
          Deliver when ready
        {% endif %}
    {% endcase %}
  {% endif %}
{% endcapture %}

{% capture email_title %}
    Security check
{% endcapture %}
<!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" media="screen" href="/assets/admin/merchant_mailer/style.css">
  <style data-premailer="ignore">
    .button__cell { background: {{ shop.email_accent_color }}; }
    a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
    @media print{
      body {
        color: black !important;
      }

      .subtitle-lines,
      .subtotal-line__title,
      .subtotal-line__value {
        padding: 0 !important;
        margin: 0 !important;
      }

      .subtotal-table {
        margin: 0 !important;
      }
    }
  </style>
</head>

    <body>
        <table class="row">
            <tr class="mail-priority-indicator mail-priority-indicator--{% if fulfillment_aborted or has_high_risks? %}high{% else %}low{% endif %}">
                <td></td>
            </tr>
        </table>
        <table class="body">
            <tr>
                <td>
                    {% if fulfillment_aborted %}
                        <center>
                            <table class="row banner-container banner-alert__table">
    <tr>
        <td class="banner-alert__cell">
            <img src="{{ 'mailer/merchant/critical_alert.png' | cdn_asset_url }}" alt="Critical Alert" width="20px">
        </td>
        <td class="banner-description__cell">
            <strong class="banner-alert__title">Order was not fulfilled automatically</strong>
            High risk of fraud detected. Before fulfilling this order or capturing payment, please review the the Risk Analysis and determine if this order is fraudulent.
        </td>
    </tr>
</table>

                        </center>
                    {% endif %}
                    {% if has_high_risks? %}
                        <center>
                            <table class="row banner-container banner-alert__table">
    <tr>
        <td class="banner-alert__cell">
            <img src="{{ 'mailer/merchant/critical_alert.png' | cdn_asset_url }}" alt="Critical Alert" width="20px">
        </td>
        <td class="banner-description__cell">
            <strong class="banner-alert__title">High risk of fraud detected</strong>
            Before fulfilling this order or capturing payment, please review the the Risk Analysis and determine if this order is fraudulent.
        </td>
    </tr>
</table>

                        </center>
                    {% endif %}
                    <table class="row">
  <tr>
    <td class="section__cell">
      <center>
        <table class="container section">
          <tr>
            <td>

                        <table class="row content">
  <tr>
    <td class="content__cell {% if no_top_border == 'hide_border' %}no_top__border{% endif %}">
      <center>
        <table class="container">
          <tr>
            <td>

                            <table class="row">
                                <tr>
                                    <td>
                                        {% assign current_date = date | date: "%b %d" %}
                                        {% assign current_time = date | date: "%l:%M %P" %}
                                        {% if customer.name %}
                                            {{ customer.name }} placed order {{ name }} on {{ current_date }} at {{ current_time | strip }}.
                                        {% else %}
                                            Someone placed order {{ name }} on {{ current_date }} at {{ current_time | strip }}.
                                        {% endif %}
                                        <table class="row actions">
  <tr>
    <td class="empty-line"> </td>
  </tr>
  <tr>
    <td class="actions__cell">
      <table class="button main-action-cell">
        <tr>
          <td><a href="https://{{ shop.permanent_domain }}/admin/orders/{{ id }}" class="mail-button">View order</a></td>
        </tr>
      </table>
    </td>
  </tr>
</table>

                                    </td>
                                </tr>
                            </table>

            </td>
          </tr>
        </table>
      </center>
    </td>
  </tr>
</table>
                        <table class="row content">
  <tr>
    <td class="content__cell {% if no_top_border == 'hide_border' %}no_top__border{% endif %}">
      <center>
        <table class="container">
          <tr>
            <td>

                            <strong class="order-list__summary-title">Order summary</strong>
                            <br>
                            <br>

<table class="row">
  {% for line in subtotal_line_items %}
  <tr class="order-list__item">
    <td class="order-list__item__cell">
      <table>
        <td>
          {% if line.image %}
            <img src="{{ line | 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.quantity < line.quantity %}
            {% capture line_display %} {{ line.quantity }} of {{ line.quantity }} {% endcapture %}
          {% else %}
            {% assign line_display = line.quantity  %}
          {% endif %}


          <span class="order-list__item-title">{{ line.product.title }}</span><br/>

          {% if line.quantity %}
            {% if line.original_line_price != line.final_line_price %}
              <span><del class="order-list__item-original-price">{{ line.original_price | money }}</del></span>
            {% endif %}
             <span>{{ line.final_price | money }} × {{ line.quantity }} </span><br/>
          {% endif %}

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

            {% if line.sku != blank %}
              <span class="order-list__item-variant"></span>
            {% endif %}
          {% endif %}

          {% if line.sku != blank %}
            <span class="order-list__item-variant">SKU: {{ line.sku }}</span>
          {% endif %}

          {% if line.selling_plan_allocation != nil %}
            <p class="order-list__item-variant">{{ line.selling_plan_allocation.selling_plan.name }}</p>
          {% endif %}

        </td>
          <td class="order-list__price-cell">
            <p class="order-list__item-price">
              {% if line.final_line_price > 0 %}
                {{ line.final_line_price | money }}
              {% else %}
                Free
              {% endif %}
            </p>
          </td>
      </table>
    </td>
  </tr>{% endfor %}
</table>

                            <table class="row subtotal-lines">
  <tr>
    <td>
      <table class="row subtotal-table">


        {% assign discount_value = 0 %}
        {% for discount_application in discount_applications %}
          {% if discount_application.target_selection == 'all' %}
              {% assign discount_value = discount_application.total_allocated_amount %}
          {% endif %}
        {% endfor %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      {% if titleBold %}
        <span><strong>Subtotal</strong></span>
      {% else %}
        <span>Subtotal</span>
      {% endif %}
    </p>
  </td>
  <td class="subtotal-line__value">
    {% if valueBold %}
      <strong>{{ subtotal_price | plus: discount_value | money }}</strong>
    {% else %}
      {{ subtotal_price | plus: discount_value | money }}
    {% endif %}
  </td>
</tr>


        {% for discount_application in discount_applications %}
          {% if discount_application.target_selection == 'all' %}
            {% capture discount_title %}
              {% if discount_application.title %}
                {{ discount_application.title | upcase }}
              {% else %}
                Discount
              {% endif %}
            {% endcapture %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      {% if titleBold %}
        <span><strong>Discount</strong></span>
      {% else %}
        <span>Discount</span>
      {% endif %}
        <span class="subtotal-line__discount">
          <span class="subtotal-line__discount-title">{% if discount_title.size > 0 %}({{ discount_title | strip }}){% endif %}</span>
        </span>
    </p>
  </td>
  <td class="subtotal-line__value">
    {% if valueBold %}
      <strong>-{{ discount_application.total_allocated_amount | money }}</strong>
    {% else %}
      -{{ discount_application.total_allocated_amount | money }}
    {% endif %}
  </td>
</tr>

          {% endif %}
        {% endfor %}

        {% if delivery_method == 'pick-up' %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      {% if titleBold %}
        <span><strong>Pickup</strong></span>
      {% else %}
        <span>Pickup</span>
      {% endif %}
    </p>
  </td>
  <td class="subtotal-line__value">
    {% if valueBold %}
      <strong>{{ shipping_price | money }}</strong>
    {% else %}
      {{ shipping_price | money }}
    {% endif %}
  </td>
</tr>

        {% else %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      {% if titleBold %}
        <span><strong>Shipping</strong></span>
      {% else %}
        <span>Shipping</span>
      {% endif %}
        <span class="subtotal-line__discount">
          <span class="subtotal-line__discount-title">{% if shipping_method.title.size > 0 %}({{ shipping_method.title }}){% endif %}</span>
        </span>
    </p>
  </td>
  <td class="subtotal-line__value">
    {% if valueBold %}
      <strong>{{ shipping_price | money }}</strong>
    {% else %}
      {{ shipping_price | money }}
    {% endif %}
  </td>
</tr>

        {% endif %}

        {% for tax_line in tax_lines %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      {% if titleBold %}
        <span><strong>Tax</strong></span>
      {% else %}
        <span>Tax</span>
      {% endif %}
        <span class="subtotal-line__discount">
          <span class="subtotal-line__discount-title">{% if tax_line.title.size > 0 %}({{ tax_line.title }} {{ tax_line.rate | times: 100 }}%){% endif %}</span>
        </span>
    </p>
  </td>
  <td class="subtotal-line__value">
    {% if valueBold %}
      <strong>{{ tax_line.price | money }}</strong>
    {% else %}
      {{ tax_line.price | money }}
    {% endif %}
  </td>
</tr>

        {% endfor %}

      </table>
      <table class="row subtotal-table subtotal-table--total">

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      {% if titleBold %}
        <span><strong>Total</strong></span>
      {% else %}
        <span>Total</span>
      {% endif %}
    </p>
  </td>
  <td class="subtotal-line__value">
    {% if valueBold %}
      <strong>{{ total_price | money_with_currency }}</strong>
    {% else %}
      {{ total_price | money_with_currency }}
    {% endif %}
  </td>
</tr>

      </table>
    </td>
  </tr>
</table>


            </td>
          </tr>
        </table>
      </center>
    </td>
  </tr>
</table>
                        <table class="row content">
  <tr>
    <td class="content__cell {% if no_top_border == 'hide_border' %}no_top__border{% endif %}">
      <center>
        <table class="container">
          <tr>
            <td>

                            {% if gateway %}
                                <table class="row">
                                    <tr>
                                        <td class="customer-info__item customer-info__item--last">
                                            <strong>Payment processing method</strong>
                                            <br>
                                            <p>{{ gateway }}</p>
                                        </td>
                                    </tr>
                                </table>
                            {% endif %}
                            {% if requires_shipping and shipping_address %}
                                {% if shipping_methods.first %}
                                    <br>
                                    <table class="row">
                                        <tr>
                                            <td class="customer-info__item customer-info__item--last">
                                                <strong>Delivery method</strong>
                                                <br>
                                                {% for shipping_method in shipping_methods %}
                                                    <p>{{ shipping_method.title }}</p>
                                                {% endfor %}
                                                <p>{{ alpaca_delivery_method_details }}</p>
                                            </td>
                                        </tr>
                                    </table>
                                {% endif %}
                                <br>
                                <table class="row">
                                    <tr>
                                        <td class="customer-info__item customer-info__item--last">
                                            <strong>Shipping address</strong>
                                            <br>
                                            <p>
                                                {{ shipping_address.name }}<br>
                                                {{ shipping_address.street }}<br>
                                                {{ shipping_address.city }},
                                                {{ shipping_address.province }}
                                                {{ shipping_address.zip }}<br>
                                                {{ shipping_address.country }}<br>
                                                {{ shipping_address.phone }}<br>
                                            </p>
                                        </td>
                                    </tr>
                                </table>
                            {% endif %}

            </td>
          </tr>
        </table>
      </center>
    </td>
  </tr>
</table>

            </td>
          </tr>
        </table>
      </center>
    </td>
  </tr>
</table>
                    <footer class="no-print">
  <br>
  <table border="0" cellpadding="0" cellspacing="0" class="mail-footer">
    <tbody>
      <tr>
        <td align="center" valign="bottom">
          <img src="{{ 'mailer/merchant/shopify_logo.png' | cdn_asset_url }}" alt="Shopify" width="89">
        </td>
      </tr>
      <tr>
        <td align="center">
          <p>© Shopify | <span class="apple-link">151 O'Connor Street, Ground floor, Ottawa, ON, K2P 2L8</span></span></p>
        </td>
      </tr>
    </tbody>
  </table>
</footer>

<img class="no-print" src="{{ 'notifications/spacer.png' | shopify_asset_url }}" class="spacer" height="1" />

                </td>
            </tr>
        </table>
    </body>
</html>

More support articles

Hide irrelevant rates

Only show the pickup or delivery rate the customer already selected

Updated on December 11, 2021

Display per-location inventory on product pages

Let your customers know which locations have items in stock

Updated on September 30, 2021

Custom messaging for ineligible carts and locations

Notify users when their cart or location isn't eligible for pickup or delivery

Updated on June 14, 2021

Location-specific notifications

Notify locations when they receive orders

Updated on May 18, 2021

Require advance notice for scheduled pickup / delivery

Specify how much time you need to prepare for pickup and delivery orders.

Updated on April 8, 2021

Configure your own Google Maps API key

How to get a Google Maps API key so you can enable address autocomplete

Updated on April 8, 2021

Disable scheduling until orders are marked as packed

Don't let customers schedule a pickup or delivery until the order is marked as packed

Updated on April 8, 2021

Prevent out-of-stock inventory when checking out

Prompt customers to remove out-of-stock inventory when they try to check out

Updated on April 6, 2021

How to show Alpaca's rates in your checkout

Add Alpaca rates to your Shopify shipping profiles

Updated on April 6, 2021

Theme integration placement

Control where Alpaca appears on your theme

Updated on March 26, 2021

Removing Alpaca from your theme

How to completely remove Alpaca from your online store

Updated on March 24, 2021

Update an order's delivery method

Manually change an order's delivery method and/or scheduled date and time

Updated on March 22, 2021

Disable rescheduling

Don't let your customers reschedule their pickup/delivery date and time

Updated on March 17, 2021

Carrier Service

How Alpaca adds pickup and delivery rates to your checkout

Updated on March 17, 2021

Prevent mixed carts

Prompt customers to remove items which aren't eligible for their selected delivery method.

Updated on March 16, 2021

Removing the shipping option from delivery methods

How to hide the shipping delivery method in Alpaca's theme integration

Updated on March 6, 2021

Require customers to schedule a pickup/delivery before checkout

Ensure your customers pick a time before completing their checkout

Updated on March 5, 2021

Non-physical items and shipping rates

Why shipping rates and delivery methods may not appear on your website

Updated on March 5, 2021

Optimized local delivery routes

Generate optimized delivery routes for your Shopify orders

Updated on March 5, 2021

Restrict pickup/delivery dates for specific products

Great for handling pre-orders and seasonal products

Updated on March 4, 2021

Hiding line item attributes

How to hide _alpaca_id attributes from appearing

Updated on December 9, 2020

Liquid variables in notifications

How to add dynamic content to your notifications

Updated on October 13, 2020

Delivery rates by zip / postal code

How to restrict local delivery rates to specific zip or postal codes

Updated on August 25, 2020

How to add or edit pickup schedules

Set when you offer pickup and other options regarding curbside pickup

Updated on June 2, 2020

How to add or edit local delivery rates

Manage the prices and options for local delivery

Updated on June 2, 2020

Change the look-and-feel of the pickup call-to-action

How to modify the fonts and colors of the pickup CTA

Updated on June 2, 2020

Add a pickup call-to-action to your theme

How to display a pickup CTA on your storefront

Updated on June 2, 2020


Still need help?

Send us an email and we'll get back to you as soon as we can.

Free 14-day trial

Try Alpaca for free, no risk, no hassle

Get started