docs: rename data to event in subscribers across docs (#8149)
This commit is contained in:
@@ -116,14 +116,14 @@ To test the module out, create a simple subscriber at `src/subscribers/product-c
|
||||
|
||||
export const highlights = [
|
||||
["12", "notificationModuleService", "Resolve the Notification Module."],
|
||||
["17", "create", "Create the notification to be sent."],
|
||||
["15", "create", "Create the notification to be sent."],
|
||||
[
|
||||
"19",
|
||||
"17",
|
||||
'"email"',
|
||||
"By specifying the `email` channel, SendGrid will be used to send the notification.",
|
||||
],
|
||||
["20", '"product-created"', "The ID of the template defined in SendGrid."],
|
||||
["21", "data", "The data to pass to the template defined in SendGrid."],
|
||||
["18", '"product-created"', "The ID of the template defined in SendGrid."],
|
||||
["19", "data", "The data to pass to the template defined in SendGrid."],
|
||||
]
|
||||
|
||||
```ts title="src/subscribers/product-created.ts" highlights={highlights} collapsibleLines="1-7" expandButtonLabel="Show Imports"
|
||||
@@ -135,7 +135,7 @@ import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { INotificationModuleService } from "@medusajs/types"
|
||||
|
||||
export default async function productCreateHandler({
|
||||
data,
|
||||
event: { data },
|
||||
container,
|
||||
}: SubscriberArgs<{ id: string }>) {
|
||||
const notificationModuleService: INotificationModuleService =
|
||||
@@ -145,7 +145,7 @@ export default async function productCreateHandler({
|
||||
to: "test@gmail.com",
|
||||
channel: "email",
|
||||
template: "product-created",
|
||||
data: data.data,
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user