fix(notification): Properly disable notification providers (#8607)
This commit is contained in:
@@ -17,8 +17,8 @@ import {
|
||||
promiseAll,
|
||||
} from "@medusajs/utils"
|
||||
import { Notification } from "@models"
|
||||
import NotificationProviderService from "./notification-provider"
|
||||
import { eventBuilders } from "@utils"
|
||||
import NotificationProviderService from "./notification-provider"
|
||||
|
||||
type InjectedDependencies = {
|
||||
baseRepository: DAL.RepositoryService
|
||||
@@ -138,6 +138,13 @@ export default class NotificationModuleService
|
||||
)
|
||||
}
|
||||
|
||||
if (!provider.is_enabled) {
|
||||
throw new MedusaError(
|
||||
MedusaError.Types.NOT_FOUND,
|
||||
`Notification provider ${provider.id} is not enabled. To enable it, configure it as a provider in the notification module options.`
|
||||
)
|
||||
}
|
||||
|
||||
const res = await this.notificationProviderService_.send(
|
||||
provider,
|
||||
entry
|
||||
|
||||
Reference in New Issue
Block a user