@@ -18,16 +18,15 @@ export const OrderPlacedTemplate = ({ orderId }: { orderId: string }) => {
1818 if ( order ?. display_id ) {
1919 const shippingAddressText = getFormattedAddress ( { address : order . shipping_address } ) . join ( "<br/>" ) ;
2020 const billingAddressText = getFormattedAddress ( { address : order . billing_address } ) . join ( "<br/>" ) ;
21- const templateData = {
22- // subject: `#${order.display_id} - Zamówienie zostało złożone`,
21+ const templateData : any = {
2322 orderNumber : `#${ order . display_id } ` ,
2423 customerName : order . email ,
2524 customerEmail : order . email ,
2625 orderDate : formatDate ( { date : order . created_at , includeTime : true , localeCode : "pl" } ) ,
2726 totalAmount : order . items . reduce ( ( acc , item ) => acc + ( item . variant ?. prices ?. [ 0 ] ?. amount || 0 ) * item . quantity , 0 ) ,
28- currency : order . currency_code ,
27+ currency_code : order . currency_code ,
2928 items : order . items . map ( ( item ) => ( {
30- thumbnail : item . thumbnail ,
29+ thumbnail : item . thumbnail == null ? "" : item . thumbnail ,
3130 title : item . title ,
3231 quantity : item . quantity ,
3332 price : getLocaleAmount ( item . unit_price , order . currency_code ) ,
@@ -38,8 +37,7 @@ export const OrderPlacedTemplate = ({ orderId }: { orderId: string }) => {
3837 total : getLocaleAmount ( order . summary . original_order_total , order . currency_code ) ,
3938 paid_total : getLocaleAmount ( getTotalCaptured ( order . payment_collections || [ ] ) , order . currency_code ) ,
4039 tax_total : getLocaleAmount ( order . tax_total , order . currency_code ) ,
41- discount_total : getLocaleAmount ( order . discount_total , order . currency_code ) ,
42- currency : order . currency_code ,
40+ discount_total : getLocaleAmount ( order . discount_total , order . currency_code )
4341 } ,
4442 sales_channel : {
4543 name : order ?. sales_channel ?. name ,
0 commit comments