|
1 | 1 | import SendGrid from "@sendgrid/mail" |
2 | 2 | import { humanizeAmount, zeroDecimalCurrencies } from "medusa-core-utils" |
3 | | -import { NotificationService } from "medusa-interfaces" |
4 | 3 | import { MedusaError } from "@medusajs/utils" |
5 | 4 | import { AttachmentsArray, FromFullFilementService, NewLineItem, SendGridData } from "../types/generic" |
6 | 5 | import { PluginOptions } from "../types" |
7 | | -import type { CartService, ClaimService, FulfillmentProviderService, |
8 | | - GiftCardService, LineItem, LineItemService, Logger, Order, OrderService, ProductVariantService, Return, ReturnItem, ReturnService, |
9 | | - StoreService, SwapService, TotalsService } from "@medusajs/medusa" |
| 6 | +import { |
| 7 | + AbstractNotificationService, CartService, ClaimService, FulfillmentProviderService, |
| 8 | + GiftCardService, LineItem, LineItemService, Logger, Order, OrderService, ProductVariantService, Return, ReturnItem, ReturnService, |
| 9 | + StoreService, SwapService, TotalsService |
| 10 | +} from "@medusajs/medusa" |
10 | 11 |
|
11 | | -export class SendGridService extends NotificationService { |
| 12 | +export class SendGridService extends AbstractNotificationService { |
12 | 13 | static identifier = "sendgrid" |
13 | 14 |
|
14 | 15 | options_: PluginOptions |
@@ -58,7 +59,8 @@ export class SendGridService extends NotificationService { |
58 | 59 | }, |
59 | 60 | options: PluginOptions |
60 | 61 | ) { |
61 | | - super() |
| 62 | + // @ts-expect-error prefer-rest-params |
| 63 | + super(...arguments) |
62 | 64 |
|
63 | 65 | this.options_ = options |
64 | 66 |
|
@@ -370,7 +372,7 @@ export class SendGridService extends NotificationService { |
370 | 372 | .then(() => "sent") |
371 | 373 | .catch(() => "failed") |
372 | 374 |
|
373 | | - return { to: sendOptions.to, status, data: sendOptions } |
| 375 | + return { to: sendOptions.to as string, status, data: sendOptions as unknown as Record<string, unknown> } |
374 | 376 | } |
375 | 377 |
|
376 | 378 |
|
|
0 commit comments