@aglyn/plugins-commerce 1.0.0-beta.264 → 1.0.0-beta.266

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/package.json +13 -13
  2. package/src/lib/components/console/product-editor-dialog.component.js +10 -1
  3. package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
  4. package/src/lib/components/console/products-hub-card.component.js +11 -10
  5. package/src/lib/components/console/products-hub-card.component.js.map +1 -1
  6. package/src/lib/server/billing-webhook.js +3 -1
  7. package/src/lib/server/billing-webhook.js.map +1 -1
  8. package/src/lib/server/pos-payment.js +9 -5
  9. package/src/lib/server/pos-payment.js.map +1 -1
  10. package/src/lib/server/pos-terminal.d.ts +12 -1
  11. package/src/lib/server/pos-terminal.js +82 -3
  12. package/src/lib/server/pos-terminal.js.map +1 -1
  13. package/src/lib/server/printers.js +33 -5
  14. package/src/lib/server/printers.js.map +1 -1
  15. package/src/lib/server/product-drafts.js +3 -2
  16. package/src/lib/server/product-drafts.js.map +1 -1
  17. package/src/lib/server/product-writer.js +3 -1
  18. package/src/lib/server/product-writer.js.map +1 -1
  19. package/src/lib/server/products-write.js +3 -2
  20. package/src/lib/server/products-write.js.map +1 -1
  21. package/src/lib/server/returns.js +3 -1
  22. package/src/lib/server/returns.js.map +1 -1
  23. package/src/lib/tenant-emails.js +264 -84
  24. package/src/lib/tenant-emails.js.map +1 -1
  25. package/src/lib/testing/memory-firestore.d.ts +5 -3
  26. package/src/lib/testing/memory-firestore.js +6 -3
  27. package/src/lib/testing/memory-firestore.js.map +1 -1
  28. package/src/lib/transfer/products.server.js +3 -2
  29. package/src/lib/transfer/products.server.js.map +1 -1
@@ -83,23 +83,23 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
83
83
  defaultBody: [
84
84
  {
85
85
  block: 'text',
86
- text: 'Thanks for your purchase!',
87
- variant: 'heading'
86
+ text: '{{host.businessName}} · Order {{order.number}}',
87
+ variant: 'eyebrow'
88
88
  },
89
89
  {
90
90
  block: 'text',
91
- text: 'Here is the receipt for your order from {{host.businessName}}.',
92
- variant: 'body'
91
+ text: 'Thanks for your order',
92
+ variant: 'heading'
93
93
  },
94
94
  {
95
95
  block: 'text',
96
- text: '{{order.summary}}',
96
+ text: 'Here is the receipt for your order from {{host.businessName}}. We will email you again as your order moves along, and the order page always shows where it is.',
97
97
  variant: 'body'
98
98
  },
99
99
  {
100
100
  block: 'text',
101
- text: 'Total charged: {{order.total}}',
102
- variant: 'body'
101
+ text: '{{order.summary}}\nTotal charged: {{order.total}}',
102
+ variant: 'details'
103
103
  },
104
104
  {
105
105
  block: 'text',
@@ -113,7 +113,7 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
113
113
  },
114
114
  {
115
115
  block: 'text',
116
- text: 'Order reference: {{order.ref}}',
116
+ text: 'Order {{order.number}} · payment reference {{order.ref}}. Questions about your order? Reply to this email and {{host.businessName}} will get back to you.',
117
117
  variant: 'caption'
118
118
  }
119
119
  ],
@@ -157,6 +157,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
157
157
  ORDER_STATUS_URL_TOKEN
158
158
  ],
159
159
  defaultBody: [
160
+ {
161
+ block: 'text',
162
+ text: '{{host.businessName}} · Order {{order.number}}',
163
+ variant: 'eyebrow'
164
+ },
160
165
  {
161
166
  block: 'text',
162
167
  text: 'Your order is on its way',
@@ -164,13 +169,13 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
164
169
  },
165
170
  {
166
171
  block: 'text',
167
- text: '{{host.businessName}} shipped items from order {{order.number}}.',
172
+ text: '{{host.businessName}} shipped these items from order {{order.number}}.',
168
173
  variant: 'body'
169
174
  },
170
175
  {
171
176
  block: 'text',
172
177
  text: '{{shipment.summary}}',
173
- variant: 'body'
178
+ variant: 'details'
174
179
  },
175
180
  {
176
181
  block: 'text',
@@ -186,6 +191,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
186
191
  block: 'button',
187
192
  label: 'Track your order',
188
193
  href: '{{order.statusUrl}}'
194
+ },
195
+ {
196
+ block: 'text',
197
+ text: 'The order page shows every shipment and its tracking as it moves. Questions about your order? Reply to this email and {{host.businessName}} will get back to you.',
198
+ variant: 'caption'
189
199
  }
190
200
  ],
191
201
  footerReason: ORDER_FOOTER_REASON
@@ -208,6 +218,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
208
218
  ORDER_STATUS_URL_TOKEN
209
219
  ],
210
220
  defaultBody: [
221
+ {
222
+ block: 'text',
223
+ text: '{{host.businessName}} · Order {{order.number}}',
224
+ variant: 'eyebrow'
225
+ },
211
226
  {
212
227
  block: 'text',
213
228
  text: 'Your order was delivered',
@@ -215,13 +230,13 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
215
230
  },
216
231
  {
217
232
  block: 'text',
218
- text: '{{host.businessName}} marked order {{order.number}} as delivered.',
233
+ text: '{{host.businessName}} marked order {{order.number}} as delivered. We hope you enjoy it.',
219
234
  variant: 'body'
220
235
  },
221
236
  {
222
237
  block: 'text',
223
238
  text: '{{order.summary}}',
224
- variant: 'body'
239
+ variant: 'details'
225
240
  },
226
241
  {
227
242
  block: 'button',
@@ -230,7 +245,7 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
230
245
  },
231
246
  {
232
247
  block: 'text',
233
- text: 'If something is missing or not right, reply to this email or ' + 'contact {{host.businessName}}.',
248
+ text: 'Something missing or not right? Reply to this email and {{host.businessName}} will sort it out.',
234
249
  variant: 'caption'
235
250
  }
236
251
  ],
@@ -264,6 +279,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
264
279
  ORDER_STATUS_URL_TOKEN
265
280
  ],
266
281
  defaultBody: [
282
+ {
283
+ block: 'text',
284
+ text: '{{host.businessName}} · Order {{order.number}}',
285
+ variant: 'eyebrow'
286
+ },
267
287
  {
268
288
  block: 'text',
269
289
  text: 'Your refund is on its way',
@@ -271,28 +291,28 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
271
291
  },
272
292
  {
273
293
  block: 'text',
274
- text: '{{host.businessName}} refunded {{refund.amount}} on order ' + '{{order.number}}.',
294
+ text: '{{host.businessName}} refunded {{refund.amount}} on order {{order.number}}.',
275
295
  variant: 'body'
276
296
  },
277
297
  {
278
298
  block: 'text',
279
- text: '{{refund.summary}}',
280
- variant: 'body'
299
+ text: '{{refund.summary}}\nTotal refunded: {{refund.amount}}',
300
+ variant: 'details'
281
301
  },
282
302
  {
283
303
  block: 'text',
284
304
  text: '{{refund.note}}',
285
305
  variant: 'body'
286
306
  },
287
- {
288
- block: 'text',
289
- text: 'Refunds go back to the original payment method and usually ' + 'appear within 5 to 10 business days, depending on your bank.',
290
- variant: 'caption'
291
- },
292
307
  {
293
308
  block: 'button',
294
309
  label: 'View your order',
295
310
  href: '{{order.statusUrl}}'
311
+ },
312
+ {
313
+ block: 'text',
314
+ text: 'Refunds go back to the original payment method and usually appear within 5 to 10 business days, depending on your bank.',
315
+ variant: 'caption'
296
316
  }
297
317
  ],
298
318
  footerReason: ORDER_FOOTER_REASON
@@ -320,6 +340,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
320
340
  ORDER_STATUS_URL_TOKEN
321
341
  ],
322
342
  defaultBody: [
343
+ {
344
+ block: 'text',
345
+ text: '{{host.businessName}} · Order {{order.number}}',
346
+ variant: 'eyebrow'
347
+ },
323
348
  {
324
349
  block: 'text',
325
350
  text: 'Your order was canceled',
@@ -327,13 +352,13 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
327
352
  },
328
353
  {
329
354
  block: 'text',
330
- text: '{{host.businessName}} canceled order {{order.number}}.',
355
+ text: '{{host.businessName}} canceled order {{order.number}}. These items will not be sent.',
331
356
  variant: 'body'
332
357
  },
333
358
  {
334
359
  block: 'text',
335
360
  text: '{{order.summary}}',
336
- variant: 'body'
361
+ variant: 'details'
337
362
  },
338
363
  {
339
364
  block: 'text',
@@ -344,6 +369,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
344
369
  block: 'button',
345
370
  label: 'View your order',
346
371
  href: '{{order.statusUrl}}'
372
+ },
373
+ {
374
+ block: 'text',
375
+ text: 'Questions about your order? Reply to this email and {{host.businessName}} will get back to you.',
376
+ variant: 'caption'
347
377
  }
348
378
  ],
349
379
  footerReason: ORDER_FOOTER_REASON
@@ -378,6 +408,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
378
408
  ORDER_STATUS_URL_TOKEN
379
409
  ],
380
410
  defaultBody: [
411
+ {
412
+ block: 'text',
413
+ text: '{{host.businessName}} · Order {{order.number}}',
414
+ variant: 'eyebrow'
415
+ },
381
416
  {
382
417
  block: 'text',
383
418
  text: 'Your order is ready for pickup',
@@ -385,13 +420,13 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
385
420
  },
386
421
  {
387
422
  block: 'text',
388
- text: 'Order {{order.number}} is ready at {{pickup.location}}.',
423
+ text: 'Order {{order.number}} is packed and waiting for you at {{pickup.location}}.',
389
424
  variant: 'body'
390
425
  },
391
426
  {
392
427
  block: 'text',
393
- text: '{{order.summary}}',
394
- variant: 'body'
428
+ text: '{{order.summary}}\nPick up at: {{pickup.location}}',
429
+ variant: 'details'
395
430
  },
396
431
  {
397
432
  block: 'text',
@@ -403,15 +438,15 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
403
438
  text: '{{pickup.instructions}}',
404
439
  variant: 'body'
405
440
  },
406
- {
407
- block: 'text',
408
- text: 'Bring your order number, {{order.number}}.',
409
- variant: 'caption'
410
- },
411
441
  {
412
442
  block: 'button',
413
443
  label: 'View your order',
414
444
  href: '{{order.statusUrl}}'
445
+ },
446
+ {
447
+ block: 'text',
448
+ text: 'Bring your order number, {{order.number}}. Questions about your order? Reply to this email and {{host.businessName}} will get back to you.',
449
+ variant: 'caption'
415
450
  }
416
451
  ],
417
452
  footerReason: ORDER_FOOTER_REASON
@@ -435,6 +470,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
435
470
  ORDER_STATUS_URL_TOKEN
436
471
  ],
437
472
  defaultBody: [
473
+ {
474
+ block: 'text',
475
+ text: '{{host.businessName}} · Order {{order.number}}',
476
+ variant: 'eyebrow'
477
+ },
438
478
  {
439
479
  block: 'text',
440
480
  text: 'Thanks for picking up your order',
@@ -442,17 +482,22 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
442
482
  },
443
483
  {
444
484
  block: 'text',
445
- text: 'Order {{order.number}} was picked up from {{pickup.location}}.',
485
+ text: 'Order {{order.number}} was picked up from {{pickup.location}}. Enjoy it.',
446
486
  variant: 'body'
447
487
  },
448
488
  {
449
489
  block: 'text',
450
- text: '{{order.summary}}',
451
- variant: 'body'
490
+ text: '{{order.summary}}\nPicked up at: {{pickup.location}}',
491
+ variant: 'details'
492
+ },
493
+ {
494
+ block: 'button',
495
+ label: 'View your order',
496
+ href: '{{order.statusUrl}}'
452
497
  },
453
498
  {
454
499
  block: 'text',
455
- text: 'If something is missing or not right, reply to this email or ' + 'contact {{host.businessName}}.',
500
+ text: 'Something missing or not right? Reply to this email and {{host.businessName}} will sort it out.',
456
501
  variant: 'caption'
457
502
  }
458
503
  ],
@@ -483,23 +528,33 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
483
528
  defaultBody: [
484
529
  {
485
530
  block: 'text',
486
- text: 'Your order is on its way',
531
+ text: '{{host.businessName}} · Order {{order.number}}',
532
+ variant: 'eyebrow'
533
+ },
534
+ {
535
+ block: 'text',
536
+ text: 'Your order is out for delivery',
487
537
  variant: 'heading'
488
538
  },
489
539
  {
490
540
  block: 'text',
491
- text: '{{host.businessName}} is out delivering order {{order.number}}. ' + 'Your window: {{delivery.window}}.',
541
+ text: '{{host.businessName}} is on the way with order {{order.number}}.',
492
542
  variant: 'body'
493
543
  },
494
544
  {
495
545
  block: 'text',
496
- text: '{{order.summary}}',
497
- variant: 'body'
546
+ text: '{{order.summary}}\nDelivery window: {{delivery.window}}',
547
+ variant: 'details'
498
548
  },
499
549
  {
500
550
  block: 'button',
501
551
  label: 'View your order',
502
552
  href: '{{order.statusUrl}}'
553
+ },
554
+ {
555
+ block: 'text',
556
+ text: 'Questions about your order? Reply to this email and {{host.businessName}} will get back to you.',
557
+ variant: 'caption'
503
558
  }
504
559
  ],
505
560
  footerReason: ORDER_FOOTER_REASON
@@ -537,9 +592,19 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
537
592
  name: 'order.ref',
538
593
  description: 'Order reference id',
539
594
  sample: 'cs_test_123'
595
+ },
596
+ {
597
+ name: 'orders.url',
598
+ description: 'The site’s Orders page in the console',
599
+ sample: 'https://app.example.com/northwind/hosts/northwind/products/orders'
540
600
  }
541
601
  ],
542
602
  defaultBody: [
603
+ {
604
+ block: 'text',
605
+ text: '{{site.name}} · New order',
606
+ variant: 'eyebrow'
607
+ },
543
608
  {
544
609
  block: 'text',
545
610
  text: 'You made a sale',
@@ -547,22 +612,22 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
547
612
  },
548
613
  {
549
614
  block: 'text',
550
- text: 'A new order came in on {{site.name}}.',
615
+ text: 'A new paid order came in on {{site.name}}. Here is what was bought and who bought it.',
551
616
  variant: 'body'
552
617
  },
553
618
  {
554
619
  block: 'text',
555
- text: '{{order.summary}}',
556
- variant: 'body'
620
+ text: '{{order.summary}}\nTotal: {{order.total}}\nBuyer: {{buyer.email}}\nPayment reference: {{order.ref}}',
621
+ variant: 'details'
557
622
  },
558
623
  {
559
- block: 'text',
560
- text: 'Total: {{order.total}}',
561
- variant: 'body'
624
+ block: 'button',
625
+ label: 'Open orders',
626
+ href: '{{orders.url}}'
562
627
  },
563
628
  {
564
629
  block: 'text',
565
- text: 'Buyer: {{buyer.email}} · Order {{order.ref}}',
630
+ text: 'Fulfill it from Orders: as you mark it shipped, ready for pickup or delivered, the buyer is emailed at each step.',
566
631
  variant: 'caption'
567
632
  }
568
633
  ],
@@ -606,28 +671,23 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
606
671
  defaultBody: [
607
672
  {
608
673
  block: 'text',
609
- text: 'Reservation confirmed',
610
- variant: 'heading'
674
+ text: '{{host.businessName}} · Reservation',
675
+ variant: 'eyebrow'
611
676
  },
612
677
  {
613
678
  block: 'text',
614
- text: 'Your stay at {{host.businessName}} is confirmed.',
615
- variant: 'body'
616
- },
617
- {
618
- block: 'text',
619
- text: 'Check-in: {{reservation.checkIn}}',
620
- variant: 'body'
679
+ text: 'Your stay is confirmed',
680
+ variant: 'heading'
621
681
  },
622
682
  {
623
683
  block: 'text',
624
- text: 'Nights: {{reservation.nights}}',
684
+ text: 'Your reservation at {{host.businessName}} is booked. Here are the details to keep.',
625
685
  variant: 'body'
626
686
  },
627
687
  {
628
688
  block: 'text',
629
- text: 'Paid today: {{reservation.paid}}',
630
- variant: 'body'
689
+ text: 'Check-in: {{reservation.checkIn}}\nNights: {{reservation.nights}}\nPaid today: {{reservation.paid}}\nReference: {{reservation.ref}}',
690
+ variant: 'details'
631
691
  },
632
692
  {
633
693
  block: 'text',
@@ -636,7 +696,7 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
636
696
  },
637
697
  {
638
698
  block: 'text',
639
- text: 'Reference: {{reservation.ref}}',
699
+ text: 'Questions before you arrive? Reply to this email and {{host.businessName}} will get back to you.',
640
700
  variant: 'caption'
641
701
  }
642
702
  ],
@@ -670,7 +730,12 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
670
730
  defaultBody: [
671
731
  {
672
732
  block: 'text',
673
- text: 'Your gift card',
733
+ text: '{{host.businessName}} · Gift card',
734
+ variant: 'eyebrow'
735
+ },
736
+ {
737
+ block: 'text',
738
+ text: 'Your {{giftcard.value}} gift card',
674
739
  variant: 'heading'
675
740
  },
676
741
  {
@@ -685,8 +750,8 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
685
750
  },
686
751
  {
687
752
  block: 'text',
688
- text: 'Gift card code: {{giftcard.code}}',
689
- variant: 'body'
753
+ text: 'Value: {{giftcard.value}}\nGift card code: {{giftcard.code}}',
754
+ variant: 'details'
690
755
  },
691
756
  {
692
757
  block: 'text',
@@ -695,8 +760,13 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
695
760
  },
696
761
  {
697
762
  block: 'button',
698
- label: 'Visit {{host.businessName}}',
763
+ label: 'Shop {{host.businessName}}',
699
764
  href: '{{host.url}}'
765
+ },
766
+ {
767
+ block: 'text',
768
+ text: 'Keep this email: the code is what you spend the card with.',
769
+ variant: 'caption'
700
770
  }
701
771
  ],
702
772
  footerReason: 'You’re receiving this because a gift card from {{host.businessName}} was sent to this address.'
@@ -732,13 +802,28 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
732
802
  defaultBody: [
733
803
  {
734
804
  block: 'text',
735
- text: '{{product.name}} is back in stock at {{host.businessName}}.',
805
+ text: '{{host.businessName}}',
806
+ variant: 'eyebrow'
807
+ },
808
+ {
809
+ block: 'text',
810
+ text: '{{product.name}} is back in stock',
811
+ variant: 'heading'
812
+ },
813
+ {
814
+ block: 'text',
815
+ text: 'You asked to hear when {{product.name}} was back at {{host.businessName}}. It is, and you can order it now.',
736
816
  variant: 'body'
737
817
  },
738
818
  {
739
819
  block: 'button',
740
- label: 'View product',
820
+ label: 'Shop {{product.name}}',
741
821
  href: '{{product.url}}'
822
+ },
823
+ {
824
+ block: 'text',
825
+ text: 'You asked {{host.businessName}} to tell you when it was back. Nothing is held for you.',
826
+ variant: 'caption'
742
827
  }
743
828
  ],
744
829
  footerReason: 'You’re receiving this because you asked {{host.businessName}} to tell you when this was back.'
@@ -764,12 +849,22 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
764
849
  defaultBody: [
765
850
  {
766
851
  block: 'text',
767
- text: 'You left items in your cart at {{host.businessName}}. Pick up ' + 'where you left off.',
852
+ text: '{{host.businessName}}',
853
+ variant: 'eyebrow'
854
+ },
855
+ {
856
+ block: 'text',
857
+ text: 'You left something in your cart',
858
+ variant: 'heading'
859
+ },
860
+ {
861
+ block: 'text',
862
+ text: 'Your cart at {{host.businessName}} still has your items in it. Pick up where you left off whenever you are ready.',
768
863
  variant: 'body'
769
864
  },
770
865
  {
771
866
  block: 'button',
772
- label: 'Return to cart',
867
+ label: 'Return to your cart',
773
868
  href: '{{cart.url}}'
774
869
  },
775
870
  {
@@ -810,6 +905,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
810
905
  }
811
906
  ],
812
907
  defaultBody: [
908
+ {
909
+ block: 'text',
910
+ text: '{{host.businessName}} · Order {{order.number}}',
911
+ variant: 'eyebrow'
912
+ },
813
913
  {
814
914
  block: 'text',
815
915
  text: 'How did we do?',
@@ -817,13 +917,13 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
817
917
  },
818
918
  {
819
919
  block: 'text',
820
- text: 'Thanks again for your order {{order.number}} from ' + '{{host.businessName}}. Would you tell other shoppers what you ' + 'think? Each link opens the product with a review form.',
920
+ text: 'Thanks again for your order {{order.number}} from {{host.businessName}}. Would you tell other shoppers what you think? Each link opens the product with a review form ready.',
821
921
  variant: 'body'
822
922
  },
823
923
  {
824
924
  block: 'text',
825
925
  text: '{{review.products}}',
826
- variant: 'body'
926
+ variant: 'links'
827
927
  },
828
928
  {
829
929
  block: 'button',
@@ -859,6 +959,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
859
959
  }
860
960
  ],
861
961
  defaultBody: [
962
+ {
963
+ block: 'text',
964
+ text: '{{host.businessName}} · Members',
965
+ variant: 'eyebrow'
966
+ },
862
967
  {
863
968
  block: 'text',
864
969
  text: '{{post.title}}',
@@ -868,6 +973,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
868
973
  block: 'text',
869
974
  text: '{{post.body}}',
870
975
  variant: 'body'
976
+ },
977
+ {
978
+ block: 'button',
979
+ label: 'Visit {{host.businessName}}',
980
+ href: '{{host.url}}'
871
981
  }
872
982
  ],
873
983
  footerReason: 'You’re receiving this because you’re a member of {{host.businessName}}.'
@@ -903,6 +1013,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
903
1013
  }
904
1014
  ],
905
1015
  defaultBody: [
1016
+ {
1017
+ block: 'text',
1018
+ text: '{{site.name}} · Account security',
1019
+ variant: 'eyebrow'
1020
+ },
906
1021
  {
907
1022
  block: 'text',
908
1023
  text: 'Reset your password',
@@ -947,6 +1062,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
947
1062
  }
948
1063
  ],
949
1064
  defaultBody: [
1065
+ {
1066
+ block: 'text',
1067
+ text: '{{site.name}} · Account security',
1068
+ variant: 'eyebrow'
1069
+ },
950
1070
  {
951
1071
  block: 'text',
952
1072
  text: 'Your password was changed',
@@ -954,7 +1074,7 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
954
1074
  },
955
1075
  {
956
1076
  block: 'text',
957
- text: 'An administrator of {{site.name}} set a new password on your ' + 'account and signed you out on every device. To sign back in, ' + 'get the new password from them, or choose "Forgot password?" on ' + 'the sign-in page to set your own.',
1077
+ text: 'An administrator of {{site.name}} set a new password on your account and signed you out on every device. To sign back in, get the new password from them, or choose "Forgot password?" on the sign-in page to set your own.',
958
1078
  variant: 'body'
959
1079
  },
960
1080
  {
@@ -964,7 +1084,7 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
964
1084
  },
965
1085
  {
966
1086
  block: 'text',
967
- text: 'If you did not expect this, contact the site owner.',
1087
+ text: 'If you did not expect this, contact the site owner straight away.',
968
1088
  variant: 'caption'
969
1089
  }
970
1090
  ],
@@ -991,6 +1111,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
991
1111
  }
992
1112
  ],
993
1113
  defaultBody: [
1114
+ {
1115
+ block: 'text',
1116
+ text: '{{host.businessName}}',
1117
+ variant: 'eyebrow'
1118
+ },
994
1119
  {
995
1120
  block: 'text',
996
1121
  text: 'Confirm your subscription',
@@ -998,9 +1123,14 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
998
1123
  },
999
1124
  {
1000
1125
  block: 'text',
1001
- text: 'Please confirm that you want to get {{stream.name}} emails from ' + '{{host.businessName}} at this address.',
1126
+ text: 'Please confirm that you want {{stream.name}} emails from {{host.businessName}} at this address. Nothing is sent until you do.',
1002
1127
  variant: 'body'
1003
1128
  },
1129
+ {
1130
+ block: 'text',
1131
+ text: 'List: {{stream.name}}\nFrom: {{host.businessName}}',
1132
+ variant: 'details'
1133
+ },
1004
1134
  {
1005
1135
  block: 'button',
1006
1136
  label: 'Confirm my subscription',
@@ -1008,7 +1138,7 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1008
1138
  },
1009
1139
  {
1010
1140
  block: 'text',
1011
- text: 'The link works for three days. If you did not sign up, ignore this ' + 'message — nothing will be sent.',
1141
+ text: 'The link works for three days. If you did not sign up, ignore this message and nothing will be sent.',
1012
1142
  variant: 'caption'
1013
1143
  }
1014
1144
  ],
@@ -1053,9 +1183,19 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1053
1183
  name: 'return.customerNote',
1054
1184
  description: 'What the buyer wrote; empty when they wrote nothing',
1055
1185
  sample: 'The lid was cracked.'
1186
+ },
1187
+ {
1188
+ name: 'return.url',
1189
+ description: 'The return in the console, to approve or decline',
1190
+ sample: 'https://app.example.com/northwind/hosts/northwind/products/returns?return=ret_123'
1056
1191
  }
1057
1192
  ],
1058
1193
  defaultBody: [
1194
+ {
1195
+ block: 'text',
1196
+ text: '{{host.businessName}} · Order {{order.number}}',
1197
+ variant: 'eyebrow'
1198
+ },
1059
1199
  {
1060
1200
  block: 'text',
1061
1201
  text: 'A buyer asked for a return',
@@ -1063,22 +1203,27 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1063
1203
  },
1064
1204
  {
1065
1205
  block: 'text',
1066
- text: '{{buyer.email}} wants to return items from order {{order.number}}.',
1206
+ text: '{{buyer.email}} wants to return items from order {{order.number}}. Approve or decline it, and the buyer is emailed your answer.',
1067
1207
  variant: 'body'
1068
1208
  },
1069
1209
  {
1070
1210
  block: 'text',
1071
- text: '{{return.items}}',
1072
- variant: 'body'
1211
+ text: '{{return.items}}\nBuyer: {{buyer.email}}',
1212
+ variant: 'details'
1073
1213
  },
1074
1214
  {
1075
1215
  block: 'text',
1076
1216
  text: '{{return.customerNote}}',
1077
1217
  variant: 'body'
1078
1218
  },
1219
+ {
1220
+ block: 'button',
1221
+ label: 'Review the return',
1222
+ href: '{{return.url}}'
1223
+ },
1079
1224
  {
1080
1225
  block: 'text',
1081
- text: 'Approve or decline it under Products → Returns.',
1226
+ text: 'Returns are under Products → Returns, beside the order they are for.',
1082
1227
  variant: 'caption'
1083
1228
  }
1084
1229
  ],
@@ -1104,6 +1249,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1104
1249
  ORDER_STATUS_URL_TOKEN
1105
1250
  ],
1106
1251
  defaultBody: [
1252
+ {
1253
+ block: 'text',
1254
+ text: '{{host.businessName}} · Order {{order.number}}',
1255
+ variant: 'eyebrow'
1256
+ },
1107
1257
  {
1108
1258
  block: 'text',
1109
1259
  text: 'Your return is approved',
@@ -1111,13 +1261,18 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1111
1261
  },
1112
1262
  {
1113
1263
  block: 'text',
1114
- text: '{{host.businessName}} approved the return of:',
1264
+ text: '{{host.businessName}} approved the return of these items from order {{order.number}}.',
1115
1265
  variant: 'body'
1116
1266
  },
1117
1267
  {
1118
1268
  block: 'text',
1119
1269
  text: '{{return.items}}',
1120
- variant: 'body'
1270
+ variant: 'details'
1271
+ },
1272
+ {
1273
+ block: 'text',
1274
+ text: 'What to do next',
1275
+ variant: 'subheading'
1121
1276
  },
1122
1277
  {
1123
1278
  block: 'text',
@@ -1133,6 +1288,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1133
1288
  block: 'button',
1134
1289
  label: 'View your order',
1135
1290
  href: '{{order.statusUrl}}'
1291
+ },
1292
+ {
1293
+ block: 'text',
1294
+ text: 'Your refund is sent once {{host.businessName}} receives the items, and you will get an email when it is.',
1295
+ variant: 'caption'
1136
1296
  }
1137
1297
  ],
1138
1298
  footerReason: ORDER_FOOTER_REASON
@@ -1152,6 +1312,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1152
1312
  ORDER_STATUS_URL_TOKEN
1153
1313
  ],
1154
1314
  defaultBody: [
1315
+ {
1316
+ block: 'text',
1317
+ text: '{{host.businessName}} · Order {{order.number}}',
1318
+ variant: 'eyebrow'
1319
+ },
1155
1320
  {
1156
1321
  block: 'text',
1157
1322
  text: 'We could not accept this return',
@@ -1159,13 +1324,13 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1159
1324
  },
1160
1325
  {
1161
1326
  block: 'text',
1162
- text: '{{host.businessName}} declined the return of:',
1327
+ text: '{{host.businessName}} declined the return of these items from order {{order.number}}.',
1163
1328
  variant: 'body'
1164
1329
  },
1165
1330
  {
1166
1331
  block: 'text',
1167
1332
  text: '{{return.items}}',
1168
- variant: 'body'
1333
+ variant: 'details'
1169
1334
  },
1170
1335
  {
1171
1336
  block: 'text',
@@ -1176,6 +1341,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1176
1341
  block: 'button',
1177
1342
  label: 'View your order',
1178
1343
  href: '{{order.statusUrl}}'
1344
+ },
1345
+ {
1346
+ block: 'text',
1347
+ text: 'Questions about it? Reply to this email and {{host.businessName}} will get back to you.',
1348
+ variant: 'caption'
1179
1349
  }
1180
1350
  ],
1181
1351
  footerReason: ORDER_FOOTER_REASON
@@ -1199,6 +1369,11 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1199
1369
  ORDER_STATUS_URL_TOKEN
1200
1370
  ],
1201
1371
  defaultBody: [
1372
+ {
1373
+ block: 'text',
1374
+ text: '{{host.businessName}} · Order {{order.number}}',
1375
+ variant: 'eyebrow'
1376
+ },
1202
1377
  {
1203
1378
  block: 'text',
1204
1379
  text: 'Your return is refunded',
@@ -1206,18 +1381,23 @@ const ORDER_FOOTER_REASON = 'You’re receiving this because you placed an order
1206
1381
  },
1207
1382
  {
1208
1383
  block: 'text',
1209
- text: '{{host.businessName}} received your return and refunded ' + '{{return.refundTotal}} to your original payment method.',
1384
+ text: '{{host.businessName}} received your return and refunded {{return.refundTotal}} to your original payment method.',
1210
1385
  variant: 'body'
1211
1386
  },
1212
1387
  {
1213
1388
  block: 'text',
1214
- text: '{{return.items}}',
1215
- variant: 'body'
1389
+ text: '{{return.items}}\nTotal refunded: {{return.refundTotal}}',
1390
+ variant: 'details'
1216
1391
  },
1217
1392
  {
1218
1393
  block: 'button',
1219
1394
  label: 'View your order',
1220
1395
  href: '{{order.statusUrl}}'
1396
+ },
1397
+ {
1398
+ block: 'text',
1399
+ text: 'Refunds usually appear within 5 to 10 business days, depending on your bank.',
1400
+ variant: 'caption'
1221
1401
  }
1222
1402
  ],
1223
1403
  footerReason: ORDER_FOOTER_REASON