Advertisement
customfiy

email confirmation

Oct 27th, 2022
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.81 KB | None | 0 0
  1. {% capture email_title %}Thank you for your purchase! {% endcapture %}
  2. {% capture email_body %}
  3. {% if requires_shipping %}
  4. {% case delivery_method %}
  5. {% when 'pick-up' %}
  6. You’ll receive an email when your order is ready for pickup.
  7. {% when 'local' %}
  8. Hi {{ customer.first_name }}, we're getting your order ready for delivery.
  9. {% else %}
  10. Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent.
  11. {% endcase %}
  12. {% if delivery_instructions != blank %}
  13. <p><b>Delivery information:</b> {{ delivery_instructions }}</p>
  14. {% endif %}
  15. {% if consolidated_estimated_delivery_time %}
  16. <p>
  17. Estimated delivery <b>{{ consolidated_estimated_delivery_time }}</b>
  18. </p>
  19. {% endif %}
  20. {% endif %}
  21. {% endcapture %}
  22.  
  23. <!DOCTYPE html>
  24. <html lang="en">
  25. <head>
  26. <title>{{ email_title }}</title>
  27. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  28. <meta name="viewport" content="width=device-width">
  29. <link rel="stylesheet" type="text/css" href="/assets/notifications/styles.css">
  30. <style>
  31. .button__cell { background: {{ shop.email_accent_color }}; }
  32. a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
  33. </style>
  34. </head>
  35.  
  36. <body>
  37. <table class="body">
  38. <tr>
  39. <td>
  40. <table class="header row">
  41. <tr>
  42. <td class="header__cell">
  43. <center>
  44.  
  45. <table class="container">
  46. <tr>
  47. <td>
  48.  
  49. <table class="row">
  50. <tr>
  51. <td class="shop-name__cell">
  52. {%- if shop.email_logo_url %}
  53. <img src="{{shop.email_logo_url}}" alt="{{ shop.name }}" width="{{ shop.email_logo_width }}">
  54. {%- else %}
  55. <h1 class="shop-name__text">
  56. <a href="{{shop.url}}">{{ shop.name }}</a>
  57. </h1>
  58. {%- endif %}
  59. </td>
  60.  
  61. <td class="order-number__cell">
  62. <span class="order-number__text">
  63. Order {{ order_name }}
  64. </span>
  65. </td>
  66. </tr>
  67. </table>
  68.  
  69. </td>
  70. </tr>
  71. </table>
  72.  
  73. </center>
  74. </td>
  75. </tr>
  76. </table>
  77.  
  78. <table class="row content">
  79. <tr>
  80. <td class="content__cell">
  81. <center>
  82. <table class="container">
  83. <tr>
  84. <td>
  85.  
  86. <h2>{{ email_title }}</h2>
  87. <p>{{ email_body }}</p>
  88. {% if order_status_url %}
  89. <table class="row actions">
  90. <tr>
  91. <td class="empty-line">&nbsp;</td>
  92. </tr>
  93. <tr>
  94. <td class="actions__cell">
  95. <table class="button main-action-cell">
  96. <tr>
  97. <td class="button__cell"><a href="{{ order_status_url }}" class="button__text">View your order</a></td>
  98. </tr>
  99. </table>
  100. {% if shop.url %}
  101. <table class="link secondary-action-cell">
  102. <tr>
  103. <td class="link__cell">or <a href="{{ shop.url }}">Visit our store</a></td>
  104. </tr>
  105. </table>
  106. {% endif %}
  107.  
  108. </td>
  109. </tr>
  110. </table>
  111.  
  112. {% else %}
  113. {% if shop.url %}
  114. <table class="row actions">
  115. <tr>
  116. <td class="actions__cell">
  117. <table class="button main-action-cell">
  118. <tr>
  119. <td class="button__cell"><a href="{{ shop.url }}" class="button__text">Visit our store</a></td>
  120. </tr>
  121. </table>
  122. </td>
  123. </tr>
  124. </table>
  125. {% endif %}
  126.  
  127. {% endif %}
  128.  
  129. </td>
  130. </tr>
  131. </table>
  132. </center>
  133. </td>
  134. </tr>
  135. </table>
  136.  
  137. {% assign gift_card_line_item = line_items | where: "gift_card" %}
  138. {% if gift_card_line_item.first %}
  139. <table class="row section">
  140. <tr>
  141. <td class="section__cell">
  142. <center>
  143. <table class="container">
  144. <tr>
  145. <td>
  146. <h3>Gift card</h3>
  147. </td>
  148. </tr>
  149. </table>
  150. <table class="container">
  151. <tr>
  152. <td>
  153.  
  154. <p> You’ll receive separate emails for any gift cards.</p>
  155.  
  156. </td>
  157. </tr>
  158. </table>
  159. </center>
  160. </td>
  161. </tr>
  162. </table>
  163. {% endif %}
  164.  
  165. <table class="row section">
  166. <tr>
  167. <td class="section__cell">
  168. <center>
  169. <table class="container">
  170. <tr>
  171. <td>
  172. <h3>Order summary</h3>
  173. </td>
  174. </tr>
  175. </table>
  176. <table class="container">
  177. <tr>
  178. <td>
  179.  
  180.  
  181. <table class="row">
  182. {% for line in subtotal_line_items %}
  183. <tr class="order-list__item">
  184. <td class="order-list__item__cell">
  185. <table>
  186. <td>
  187. {% if line.image %} {% assign cst_idx = shop.metafields.customify.idx %} {% capture link_front %}{{shop.url}}/apps/customify?show_custom=1&id={{line.properties[cst_idx]}}{% endcapture %} {% capture link_back %}{{shop.url}}/apps/customify?show_custom=1&type=back_full&id={{line.properties[cst_idx]}}{% endcapture %} {% if line.properties[cst_idx] %} <img src="{{link_front}}" align="left" width="60" height="60" class="order-list__product-image"/> <br/> {{ 'view customization' | link_to: link_front }}<br/<br/> <img src="{{link_back}}" align="left" width="60" height="60" class="order-list__product-image" onError="style.display = 'none';"/> <br/> {{ 'view customization' | link_to: link_back }} {% else %} <img src="{{ line | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/> {% endif %} {% endif %}
  188.  
  189. </td>
  190. <td class="order-list__product-description-cell">
  191. {% if line.product.title %}
  192. {% assign line_title = line.product.title %}
  193. {% else %}
  194. {% assign line_title = line.title %}
  195. {% endif %}
  196.  
  197. {% if line.quantity < line.quantity %}
  198. {% capture line_display %} {{ line.quantity }} of {{ line.quantity }} {% endcapture %}
  199. {% else %}
  200. {% assign line_display = line.quantity %}
  201. {% endif %}
  202.  
  203. <span class="order-list__item-title">{{ line_title }}&nbsp;&times;&nbsp;{{ line_display }}</span><br/>
  204.  
  205. {% if line.variant.title != 'Default Title' %}
  206. <span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
  207. {% endif %}
  208.  
  209. {% if line.selling_plan_allocation %}
  210. <span class="order-list__item-variant">{{ line.selling_plan_allocation.selling_plan.name }}</span><br/>
  211. {% endif %}
  212.  
  213. {% if line.refunded_quantity > 0 %}
  214. <span class="order-list__item-refunded">Refunded</span>
  215. {% endif %}
  216.  
  217. {% if line.discount_allocations %}
  218. {% for discount_allocation in line.discount_allocations %}
  219. {% if discount_allocation.discount_application.target_selection != 'all' %}
  220. <span class="order-list__item-discount-allocation">
  221. <img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" class="discount-tag-icon" />
  222. <span>
  223. {{ discount_allocation.discount_application.title | upcase }}
  224. (-{{ discount_allocation.amount | money }})
  225. </span>
  226. </span>
  227. {% endif %}
  228. {% endfor %}
  229. {% endif %}
  230. </td>
  231. <td class="order-list__price-cell">
  232. {% if line.original_line_price != line.final_line_price %}
  233. <del class="order-list__item-original-price">{{ line.original_line_price | money }}</del>
  234. {% endif %}
  235. <p class="order-list__item-price">
  236. {% if line.final_line_price > 0 %}
  237. {{ line.final_line_price | money }}
  238. {% else %}
  239. Free
  240. {% endif %}
  241. </p>
  242. </td>
  243. </table>
  244. </td>
  245. </tr>{% endfor %}
  246. </table>
  247.  
  248. <table class="row subtotal-lines">
  249. <tr>
  250. <td class="subtotal-spacer"></td>
  251. <td>
  252. <table class="row subtotal-table">
  253. {% for discount_application in discount_applications %}
  254. {% if discount_application.target_selection == 'all' %}
  255. {% capture discount_title %}
  256. {% if discount_application.title %}
  257. {{ discount_application.title | upcase }}
  258. {% else %}
  259. Discount
  260. {% endif %}
  261. {% endcapture %}
  262.  
  263. <tr class="subtotal-line">
  264. <td class="subtotal-line__title">
  265. <p>
  266. <span>Discount</span>
  267. <span class="subtotal-line__discount">
  268. <img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" class="discount-tag-icon" />
  269. <span class="subtotal-line__discount-title">{{ discount_title }}</span>
  270. </span>
  271. </p>
  272. </td>
  273. <td class="subtotal-line__value">
  274. <strong>-{{ discount_application.total_allocated_amount | money }}</strong>
  275. </td>
  276. </tr>
  277.  
  278. {% endif %}
  279. {% endfor %}
  280.  
  281.  
  282. <tr class="subtotal-line">
  283. <td class="subtotal-line__title">
  284. <p>
  285. <span>Subtotal</span>
  286. </p>
  287. </td>
  288. <td class="subtotal-line__value">
  289. <strong>{{ subtotal_price | money }}</strong>
  290. </td>
  291. </tr>
  292.  
  293. {% if delivery_method == 'pick-up' %}
  294.  
  295. <tr class="subtotal-line">
  296. <td class="subtotal-line__title">
  297. <p>
  298. <span>Pickup</span>
  299. </p>
  300. </td>
  301. <td class="subtotal-line__value">
  302. <strong>{{ shipping_price | money }}</strong>
  303. </td>
  304. </tr>
  305.  
  306. {% else %}
  307.  
  308. <tr class="subtotal-line">
  309. <td class="subtotal-line__title">
  310. <p>
  311. <span>Shipping</span>
  312. </p>
  313. </td>
  314. <td class="subtotal-line__value">
  315. <strong>{{ shipping_price | money }}</strong>
  316. </td>
  317. </tr>
  318.  
  319. {% endif %}
  320.  
  321. {% if total_duties %}
  322.  
  323. <tr class="subtotal-line">
  324. <td class="subtotal-line__title">
  325. <p>
  326. <span>Duties</span>
  327. </p>
  328. </td>
  329. <td class="subtotal-line__value">
  330. <strong>{{ total_duties | money }}</strong>
  331. </td>
  332. </tr>
  333.  
  334. {% endif %}
  335.  
  336.  
  337. <tr class="subtotal-line">
  338. <td class="subtotal-line__title">
  339. <p>
  340. <span>Taxes</span>
  341. </p>
  342. </td>
  343. <td class="subtotal-line__value">
  344. <strong>{{ tax_price | money }}</strong>
  345. </td>
  346. </tr>
  347.  
  348.  
  349. {% if total_tip and total_tip > 0 %}
  350.  
  351. <tr class="subtotal-line">
  352. <td class="subtotal-line__title">
  353. <p>
  354. <span>Tip</span>
  355. </p>
  356. </td>
  357. <td class="subtotal-line__value">
  358. <strong>{{ total_tip | money }}</strong>
  359. </td>
  360. </tr>
  361.  
  362. {% endif %}
  363. </table>
  364. <table class="row subtotal-table subtotal-table--total">
  365.  
  366. <tr class="subtotal-line">
  367. <td class="subtotal-line__title">
  368. <p>
  369. <span>Total</span>
  370. </p>
  371. </td>
  372. <td class="subtotal-line__value">
  373. <strong>{{ total_price | money_with_currency }}</strong>
  374. </td>
  375. </tr>
  376.  
  377. </table>
  378.  
  379. {% if total_discounts > 0 %}
  380. <p class="total-discount">
  381. You saved <span class="total-discount--amount">{{ total_discounts | money }}</span>
  382. </p>
  383. {% endif %}
  384.  
  385. {% assign transaction_size = 0 %}
  386. {% assign transaction_amount = 0 %}
  387. {% for transaction in transactions %}
  388. {% if transaction.status == "success" %}
  389. {% unless transaction.kind == "authorization" or transaction.kind == "void" %}
  390. {% assign transaction_size = transaction_size | plus: 1 %}
  391. {% assign transaction_amount = transaction_amount | plus: transaction.amount %}
  392. {% endunless %}
  393. {% endif %}
  394. {% endfor %}
  395.  
  396. {% if transaction_size > 1 or transaction_amount < total_price %}
  397. <table class="row subtotal-table">
  398. <tr><td colspan="2" class="subtotal-table__line"></td></tr>
  399. <tr><td colspan="2" class="subtotal-table__small-space"></td></tr>
  400.  
  401. {% for transaction in transactions %}
  402. {% if transaction.status == "success" and transaction.kind == "capture" or transaction.kind == "sale" %}
  403. {% if transaction.payment_details.credit_card_company %}
  404. {% capture transaction_name %}{{ transaction.payment_details.credit_card_company }} (ending in {{ transaction.payment_details.credit_card_last_four_digits }}){% endcapture %}
  405. {% else %}
  406. {% capture transaction_name %}{{ transaction.gateway_display_name }}{% endcapture %}
  407. {% endif %}
  408.  
  409.  
  410. <tr class="subtotal-line">
  411. <td class="subtotal-line__title">
  412. <p>
  413. <span>{{transaction_name}}</span>
  414. </p>
  415. </td>
  416. <td class="subtotal-line__value">
  417. <strong>{{ transaction.amount | money }}</strong>
  418. </td>
  419. </tr>
  420.  
  421. {% endif %}
  422. {% if transaction.kind == 'refund' %}
  423. {% if transaction.payment_details.credit_card_company %}
  424. {% assign refund_method_title = transaction.payment_details.credit_card_company %}
  425. {% else %}
  426. {% assign refund_method_title = transaction.gateway %}
  427. {% endif %}
  428.  
  429.  
  430. <tr class="subtotal-line">
  431. <td class="subtotal-line__title">
  432. <p>
  433. <span>Refund</span>
  434. <br>
  435. <small>{{ refund_method_title | capitalize }}</small>
  436. </p>
  437. </td>
  438. <td class="subtotal-line__value">
  439. <strong>- {{ transaction.amount | money }}</strong>
  440. </td>
  441. </tr>
  442.  
  443. {% endif %}
  444. {% endfor %}
  445. </table>
  446. {% endif %}
  447. </td>
  448. </tr>
  449. </table>
  450.  
  451.  
  452. </td>
  453. </tr>
  454. </table>
  455. </center>
  456. </td>
  457. </tr>
  458. </table>
  459.  
  460. <table class="row section">
  461. <tr>
  462. <td class="section__cell">
  463. <center>
  464. <table class="container">
  465. <tr>
  466. <td>
  467. <h3>Customer information</h3>
  468. </td>
  469. </tr>
  470. </table>
  471. <table class="container">
  472. <tr>
  473. <td>
  474.  
  475. <table class="row">
  476. <tr>
  477. {% if requires_shipping and shipping_address %}
  478. <td class="customer-info__item">
  479. <h4>Shipping address</h4>
  480. {{ shipping_address | format_address }}
  481. </td>
  482. {% endif %}
  483. {% if billing_address %}
  484. <td class="customer-info__item">
  485. <h4>Billing address</h4>
  486. {{ billing_address | format_address }}
  487. </td>
  488. {% endif %}
  489. </tr>
  490. </table>
  491. <table class="row">
  492. <tr>
  493. {% if requires_shipping and shipping_address %}
  494. <td class="customer-info__item">
  495. <h4>Shipping method</h4>
  496. <p>{{ shipping_method.title }}</p>
  497. </td>
  498. {% endif %}
  499. {% assign transaction_count = transactions | size %}
  500. {% if transaction_size > 0 %}
  501. <td class="customer-info__item">
  502. <h4>Payment method</h4>
  503. {% for transaction in transactions %}
  504. {% if transaction.status == "success" or transaction.status == "pending" %}
  505. {% if transaction.kind == "capture" or transaction.kind == "sale" %}
  506. {% if transaction.payment_details.credit_card_company %}
  507. <p class="customer-info__item-content">
  508. <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 }}">
  509. <span>ending with {{ transaction.payment_details.credit_card_last_four_digits }} </span>
  510. </p>
  511. {% elsif transaction.gateway_display_name == "Gift card" %}
  512. <p class="customer-info__item-content">
  513. <img src="{{ transaction.gateway_display_name | downcase | replace: ' ', '-' | payment_type_img_url }}" class="customer-info__item-credit" height="24">
  514. ending with {{ transaction.payment_details.gift_card.last_four_characters | upcase }}<br /> &emsp;&emsp;&emsp;&nbsp;Gift card balance: {{ transaction.payment_details.gift_card.balance | money }}
  515. </p>
  516. {% else %}
  517. <p class="customer-info__item-content">
  518. {{ transaction.gateway_display_name }} </p>
  519. {% endif %}
  520. {% endif %}
  521. {% endif %}
  522. {% endfor %}
  523. </td>
  524. {% endif %}
  525. </tr>
  526. </table>
  527.  
  528. </td>
  529. </tr>
  530. </table>
  531. </center>
  532. </td>
  533. </tr>
  534. </table>
  535.  
  536. <table class="row footer">
  537. <tr>
  538. <td class="footer__cell">
  539. <center>
  540. <table class="container">
  541. <tr>
  542. <td>
  543.  
  544. <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>
  545. </td>
  546. </tr>
  547. </table>
  548. </center>
  549. </td>
  550. </tr>
  551. </table>
  552.  
  553. <img src="{{ 'notifications/spacer.png' | shopify_asset_url }}" class="spacer" height="1" />
  554.  
  555. </td>
  556. </tr>
  557. </table>
  558. </body>
  559. </html>
  560.  
  561.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement