forked from medusajs/medusa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The Notifications API allows plugins to register Notification Providers which have `sendNotification` and `resendNotification`. Each plugin can listen to any events transmittet over the event bus and the result of the notification send will be persisted in the database to allow for clear communications timeline + ability to resend notifications.
- Loading branch information
Showing
46 changed files
with
1,533 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import BaseService from "./base-service" | ||
|
||
/** | ||
* Interface for Notification Providers | ||
* @interface | ||
*/ | ||
class BaseNotificationService extends BaseService { | ||
constructor() { | ||
super() | ||
} | ||
|
||
getIdentifier() { | ||
return this.constructor.identifier | ||
} | ||
|
||
/** | ||
* Used to retrieve documents related to a shipment. | ||
*/ | ||
sendNotification(event, data) { | ||
throw new Error("Must be overridden by child") | ||
} | ||
|
||
resendNotification(notification, config = {}) { | ||
throw new Error("Must be overridden by child") | ||
} | ||
} | ||
|
||
export default BaseNotificationService |
Oops, something went wrong.