-
Notifications
You must be signed in to change notification settings - Fork 0
/
out-for-delivery.liquid
123 lines (108 loc) · 5.03 KB
/
out-for-delivery.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{% if fulfillment.item_count == item_count %}
{% capture email_title %}Your order is out for delivery{% endcapture %}
{% capture email_body %}Your order is out for delivery. Track your shipment to see the delivery status.{% endcapture %}
{% elsif fulfillment.item_count > 1 %}
{% if fulfillment_status == 'fulfilled' %}
{% capture email_title %}The last items in your order are out for delivery{% endcapture %}
{% capture email_body %}The last items in your order are out for delivery. Track your shipment to see the delivery status.{% endcapture %}
{% else %}
{% capture email_title %}Some items in your order are out for delivery{% endcapture %}
{% capture email_body %}Some items in your order are out for delivery. Track your shipment to see the delivery status.{% endcapture %}
{% endif %}
{% else %}
{% if fulfillment_status == 'fulfilled' %}
{% capture email_title %}The last item in your order is out for delivery{% endcapture %}
{% capture email_body %}The last item in your order is out for delivery. Track your shipment to see the delivery status.{% endcapture %}
{% else %}
{% capture email_title %}One item in your order is out for delivery{% endcapture %}
{% capture email_body %}One item in your order is out for delivery. Track your shipment to see the delivery status.{% endcapture %}
{% endif %}
{% endif %}
{% capture email_emphasis %}Estimated delivery date: <strong>{{fulfillment.estimated_delivery_at | date: format: 'date'}}</strong>{% 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">
<style>
.button { background: {{ shop.email_accent_color }}; }
a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
</style>
</head>
<body>
{%- if shop.email_logo_url %}
<img src="{{ shop.email_logo_url }}" alt="{{ shop.name }}" width="{{ shop.email_logo_width }}">
{%- else %}
<h1>
<a href="{{ shop.url }}">{{ shop.name }}</a>
</h1>
{%- endif %}
<h2>Order {{ order_name }}</h2>
<h2>{{ email_title }}</h2>
<p>{{ email_body }}</p>
{% if fulfillment.estimated_delivery_at %}
<p>{{ email_emphasis }}</p>
{% endif %}
{% if order_status_url %}
<a href="{{ order_status_url }}">Track my shipment</a>
{% if shop.url %}
or <a href="{{ shop.url }}">Visit our store</a>
{% endif %}
{% else %}
{% if shop.url %}
<a href="{{ shop.url }}">Visit our store</a>
{% endif %}
{% endif %}
{% if fulfillment.tracking_numbers.size > 0 %}
<p>
{% if fulfillment.tracking_numbers.size == 1 and fulfillment.tracking_company and fulfillment.tracking_url %}
{{ fulfillment.tracking_company }} tracking number: <a href="{{ fulfillment.tracking_url }}">{{ fulfillment.tracking_numbers.first }}</a>
{% elsif fulfillment.tracking_numbers.size == 1 %}
Tracking number: {{ fulfillment.tracking_numbers.first }}
{% else %}
Tracking numbers:<br />
{% for tracking_number in fulfillment.tracking_numbers %}
{{ tracking_number }}<br />
{% endfor %}
{% endif %}
</p>
{% endif %}
<h3>Items in this shipment</h3>
{% for line in fulfillment.fulfillment_line_items %}
{% if line.line_item.image %}
<img src="{{ line.line_item | img_url: 'compact_cropped' }}" align="left" width="60" height="60" />
{% endif %}
{% 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 %}
{{ line_title }} × {{ line_display }}
{% if line.line_item.variant.title != 'Default Title' %}
{{ line.line_item.variant.title }}
{% endif %}
{% if line.line_item.selling_plan_allocation %}
{{ line.line_item.selling_plan_allocation.selling_plan.name }}
{% endif %}
{% if line.line_item.refunded_quantity > 0 %}
Refunded
{% endif %}
{% if line.line_item.discount_allocations %}
{% for discount_allocation in line.line_item.discount_allocations %}
{% if discount_allocation.discount_application.target_selection != 'all' %}
<img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" />
{{ discount_allocation.discount_application.title | upcase }}
(-{{ discount_allocation.amount | money }})
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
<p>If you have any questions, reply to this email or contact us at <a href="mailto:{{ shop.email }}">{{ shop.email }}</a></p>
</body>
</html>