fix: restock
This commit is contained in:
1 parent
7897610620
commit
237ed51307
2 files changed
+9
-3
No files matched your search
@@ -39,6 +39,7 @@ class RestockNotificationService extends BaseService {
|
|||||||
options: this.options_,
|
options: this.options_,
|
||||||
eventBusService: this.eventBus_,
|
eventBusService: this.eventBus_,
|
||||||
productVariantService: this.productVariantService_,
|
productVariantService: this.productVariantService_,
|
||||||
|
restockNotificationModel: this.restockNotificationModel_,
|
||||||
})
|
})
|
||||||
|
|
||||||
cloned.transactionManager_ = transactionManager
|
cloned.transactionManager_ = transactionManager
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class SendGridService extends NotificationService {
|
|||||||
fulfillmentService,
|
fulfillmentService,
|
||||||
fulfillmentProviderService,
|
fulfillmentProviderService,
|
||||||
totalsService,
|
totalsService,
|
||||||
|
productVariantService,
|
||||||
},
|
},
|
||||||
options
|
options
|
||||||
) {
|
) {
|
||||||
@@ -46,6 +47,7 @@ class SendGridService extends NotificationService {
|
|||||||
this.swapService_ = swapService
|
this.swapService_ = swapService
|
||||||
this.fulfillmentService_ = fulfillmentService
|
this.fulfillmentService_ = fulfillmentService
|
||||||
this.totalsService_ = totalsService
|
this.totalsService_ = totalsService
|
||||||
|
this.productVariantService_ = productVariantService
|
||||||
|
|
||||||
SendGrid.setApiKey(options.api_key)
|
SendGrid.setApiKey(options.api_key)
|
||||||
}
|
}
|
||||||
@@ -122,7 +124,10 @@ class SendGridService extends NotificationService {
|
|||||||
case "customer.password_reset":
|
case "customer.password_reset":
|
||||||
return this.customerPasswordResetData(eventData, attachmentGenerator)
|
return this.customerPasswordResetData(eventData, attachmentGenerator)
|
||||||
case "restock-notification.restocked":
|
case "restock-notification.restocked":
|
||||||
return await this.restockNotificationData(eventData, attachmentGenerator)
|
return await this.restockNotificationData(
|
||||||
|
eventData,
|
||||||
|
attachmentGenerator
|
||||||
|
)
|
||||||
default:
|
default:
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
@@ -677,14 +682,14 @@ class SendGridService extends NotificationService {
|
|||||||
|
|
||||||
async restockNotificationData({ variant_id, emails }) {
|
async restockNotificationData({ variant_id, emails }) {
|
||||||
const variant = await this.productVariantService_.retrieve(variant_id, {
|
const variant = await this.productVariantService_.retrieve(variant_id, {
|
||||||
relations: ["product"]
|
relations: ["product"],
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
product: variant.product,
|
product: variant.product,
|
||||||
variant,
|
variant,
|
||||||
variant_id,
|
variant_id,
|
||||||
emails
|
emails,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user