docs: various improvements to introduction guides (#14398)

This commit is contained in:
Shahed Nasser
2025-12-24 15:37:37 +02:00
committed by GitHub
parent 10dab3a47a
commit ba3a572a89
9 changed files with 61 additions and 53 deletions
@@ -34,11 +34,9 @@ Find a list of all emitted events in [this reference](!resources!/references/eve
You create a subscriber in a TypeScript or JavaScript file under the `src/subscribers` directory. The file exports the function to execute and the subscriber's configuration that indicate what event(s) it listens to.
For example, create the file `src/subscribers/product-created.ts` with the following content:
For example, create the file `src/subscribers/order-placed.ts` with the following content:
![Example of subscriber file in the application's directory structure](https://res.cloudinary.com/dza7lstvk/image/upload/v1732866244/Medusa%20Book/subscriber-dir-overview_pusyeu.jpg)
```ts title="src/subscribers/product-created.ts"
```ts title="src/subscribers/order-placed.ts"
import { SubscriberArgs, type SubscriberConfig } from "@medusajs/framework"
import { sendOrderConfirmationWorkflow } from "../workflows/send-order-confirmation"