33 type SubscriberConfig ,
44} from "@medusajs/medusa"
55import { runSlackActionWorkflow } from "../workflows/mpn-automation/run-slack-action"
6+ import { getPluginOptions } from "../utils/plugins"
67
78/**
89 * Event name for the MPN automation action slack executed event.
@@ -28,9 +29,19 @@ export default async function mpnAutomationActionSlackExecutedHandler({
2829 eventName : triggerEventName ,
2930 contextType,
3031 } = data
31- const config = container . resolve ( "configModule" ) as any
32- const moduleConfig = config ?. modules . mpnAutomation
33- const backendUrl = moduleConfig ?. options . backend_url
32+ const pluginOptions = getPluginOptions ( container , "@codee-sh/medusa-plugin-notification-emails" )
33+ const backendUrl = pluginOptions ?. backend_url
34+
35+ // const config = container.resolve("configModule") as any
36+ // const moduleConfig = config?.modules.mpnAutomation
37+ // const backendUrl = moduleConfig?.options.backend_url
38+
39+ const contextData = {
40+ ...context ,
41+ global : {
42+ backend_url : backendUrl ,
43+ } ,
44+ }
3445
3546 // Execute slack action workflow
3647 const { result } = await runSlackActionWorkflow (
@@ -41,11 +52,10 @@ export default async function mpnAutomationActionSlackExecutedHandler({
4152 ...action ,
4253 config : {
4354 ...action . config ,
44- template : action . config . templateName ,
45- backendUrl : backendUrl ,
55+ template : action . config . templateName
4656 } ,
4757 } ,
48- context : context ,
58+ context : contextData ,
4959 contextType : contextType ,
5060 eventName : triggerEventName ,
5161 } ,
0 commit comments