markdown 修改送货确认电子邮件模板以考虑店内提货

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 修改送货确认电子邮件模板以考虑店内提货相关的知识,希望对你有一定的参考价值。

# What you want (when a customer chooses in-store pick-up)
![screenshot](https://screenshot.click/2019-06-10_14-32-42.jpg)
# What you have (when a customer chooses in-store pick-up)
![screenshot](https://screenshot.click/2019-06-10_14-31-01.jpg)
----

# How you get it 

Whenever a customer choose the in-store pick up shipping method , we want them to get a 'Your order is ready to be picked up' email, rather than a 'Your order is on the way' email. Getting the latter email whe your have seelcted in store pickup  can cause confusion and mayhem!

This tutorial is very simple Liquid, it's just something I get annoyed having to write from scratch every time!

Essentially all we are doing is modifying the Shipping Confirmation template's ` {% capture email_title %}` and ` {% capture email_body %}` logic. 

**Step 1:** Navigate to the Shipping Confirmation email template in the admin. Copy the code below and paste it into the `Email subject` field, replacing the existing code:

```{% if shipping_method.title == "Pick up" %} Order {{ name }} is ready to be picked up {% else %} A shipment from order {{ name }} is on the way {% endif %}```

**Step 2:** In the main field, delete all the code above `{% capture email_emphasis %}`. Replace it with the code below:

```
{% if fulfillment.item_count == item_count %} 

{% capture store_address %}
<br/><br/>Shop 135 - Narellan Town Centre, 
<br/>326 Camden Valley Way, 
<br/>Narellan, <br/>New South Wales 2567, 
<br/> Australia
{% endcapture %}

{% capture email_title %}
  {% if shipping_method.title == "Pick up" %} Your order is ready to be picked up  {% else %} Your order is on the way {% endif %}
{% endcapture %}

{% capture email_body %}
  {% if shipping_method.title == "Pick up" %} Your order is ready to be picked up in store.  {{ store_address }}{% else %} Your order is on the way. Track your shipment to see the delivery status. {% endif %}
{% endcapture %}

{% elsif fulfillment.item_count > 1 %} 
  {% if fulfillment_status == 'fulfilled' %}

    {% capture email_title %}
      {% if shipping_method.title == "Pick up" %} The last items in your order are ready to be picked up {% else %} The last items in your order are on the way {% endif %}
    {% endcapture %}

    {% capture email_body %}
      {% if shipping_method.title == "Pick up" %} The last items in your order are ready to be picked up in store. {{ store_address }} {% else %} The last items in your order are on the way. Track your shipment to see the delivery status. {% endif %}
    {% endcapture %}

  {% else %}
     {% capture email_title %}
       {% if shipping_method.title == "Pick up" %} Some items in your order are ready to be picked up {% else %} Some items in your order are on the way {% endif %}
     {% endcapture %}

      {% capture email_body %}
        {% if shipping_method.title == "Pick up" %} Some items in your order are ready to be picked up in store. {{ store_address }} {% else %} Some items in your order are on the way. Track your shipment to see the delivery status. {% endif %}
      {% endcapture %}

  {% endif %}
{% else %} 
  {% if fulfillment_status == 'fulfilled' %}

    {% capture email_title %}
      {% if shipping_method.title == "Pick up" %} The last item in your order is ready to be picked up {% else %} The last item in your order is on the way {% endif %}
    {% endcapture %}
      
    {% capture email_body %}
      {% if shipping_method.title == "Pick up" %} The last item in your order is ready to be picked up in store. {{ store_address }} {% else %} The last item in your order is on the way. Track your shipment to see the delivery status. {% endif %}
    {% endcapture %}

  {% else %}

    {% capture email_title %}
      {% if shipping_method.title == "Pick up" %} One item in your order is ready to be picked up {% else %} One item in your order is on the way {% endif %}
    {% endcapture %}

    {% capture email_body %}
      {% if shipping_method.title == "Pick up" %} One item in your order is ready to be picked up in store. {{ store_address }} {% else %} One item in your order is on the way. Track your shipment to see the delivery status. {% endif %}
    {% endcapture %}

  {% endif %}
{% endif %}
```
**Step 3:** In the store's admin, navigate to `Settings > Shipping` and look for the name of the merchant's in-store pick up shipping method. Highlight the name of the shipping method and copy it to your clipboard

![screenshot](https://screenshot.click/2019-06-13_15-46-50.jpg)

**Step 4:** Return to your Shipping Confirmation template. Use Ctrl + F to find all instances of the phrase `Pick up` and replace them all with the name of the merchant's in-store pick up shipping method that you just copied.

![screenshot](https://screenshot.click/2019-06-13_15-50-03.gif)

**Step 5:** Under `{% capture store_address %}`, replace the default address with your merchant's physical store address.

![screenshot](https://screenshot.click/2019-06-13_16-03-01.gif)

以上是关于markdown 修改送货确认电子邮件模板以考虑店内提货的主要内容,如果未能解决你的问题,请参考以下文章

WooCommerce - 我们如何在订单电子邮件中将送货地址更改为 N/A?

教你快速使用数据可视化BI软件创建4S店销售数据大屏

订单历史通知

Zend Framework 2 发送电子邮件模板

html 15:帐户确认电子邮件模板

markdown Odoo邮件模板