diff --git a/packages/modules/resend/src/subscribers/notification-buyer-cancel-order.ts b/packages/modules/resend/src/subscribers/notification-buyer-cancel-order.ts index c382aac1..88ba5329 100644 --- a/packages/modules/resend/src/subscribers/notification-buyer-cancel-order.ts +++ b/packages/modules/resend/src/subscribers/notification-buyer-cancel-order.ts @@ -23,6 +23,7 @@ export default async function buyerCancelOrderHandler({ "items.*", "customer.first_name", "customer.last_name", + "order_set.*", ], filters: { id: event.data.id, @@ -34,6 +35,11 @@ export default async function buyerCancelOrderHandler({ return; } + const orderUrl = buildHostAddress( + Hosts.STOREFRONT, + `/user/orders/${order.order_set.id ?? order.id}` + ).toString(); + await notificationService.createNotifications({ to: order.email, channel: "email", @@ -48,10 +54,7 @@ export default async function buyerCancelOrderHandler({ display_id: order.display_id, item: order.items, }, - order_address: buildHostAddress( - Hosts.STOREFRONT, - `/user/orders/${order.id}` - ).toString(), + order_address: orderUrl, }, }, });