docs: redesigned code blocks (#2745)
* docs: redesigned code blocks to include titles * docs: added a title where necessary
This commit is contained in:
@@ -20,7 +20,7 @@ Creating a Notification Provider is as simple as creating a TypeScript or JavaS
|
||||
|
||||
For example, create the file `src/services/email-sender.ts` with the following content:
|
||||
|
||||
```ts
|
||||
```ts title=src/services/email-sender.ts
|
||||
import { AbstractNotificationService } from "@medusajs/medusa";
|
||||
import { EntityManager } from "typeorm";
|
||||
|
||||
@@ -89,7 +89,6 @@ class EmailSenderService extends AbstractNotificationService {
|
||||
static identifier = "email-sender";
|
||||
protected orderService: OrderService;
|
||||
|
||||
// highlight-start
|
||||
constructor(container, options) {
|
||||
super(container);
|
||||
//you can access options here in case you're
|
||||
@@ -97,7 +96,6 @@ class EmailSenderService extends AbstractNotificationService {
|
||||
|
||||
this.orderService = container.orderService;
|
||||
}
|
||||
// highlight-end
|
||||
|
||||
//...
|
||||
}
|
||||
@@ -219,7 +217,7 @@ This section will not cover the basics of Subscribers. You can read the [Subscri
|
||||
|
||||
Following the previous example, to make sure the `email-sender` Notification Provider handles the `order.placed` event, create the file `src/subscribers/notification.js` with the following content:
|
||||
|
||||
```ts
|
||||
```ts title=src/subscribers/notification.js
|
||||
class NotificationSubscriber {
|
||||
constructor({ notificationService }) {
|
||||
notificationService.subscribe('order.placed', 'email-sender');
|
||||
|
||||
Reference in New Issue
Block a user