From e4c950d2f503776dd5a4596fde034141fc341219 Mon Sep 17 00:00:00 2001 From: Sheldon Guo Date: Thu, 6 Feb 2025 17:47:53 +0800 Subject: [PATCH] fix(notification): enhance sendParams structure to include content and scope data (#6164) --- .../src/server/NotificationInstruction.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugins/@nocobase/plugin-workflow-notification/src/server/NotificationInstruction.ts b/packages/plugins/@nocobase/plugin-workflow-notification/src/server/NotificationInstruction.ts index be3caf3ec8..9518d7c0df 100644 --- a/packages/plugins/@nocobase/plugin-workflow-notification/src/server/NotificationInstruction.ts +++ b/packages/plugins/@nocobase/plugin-workflow-notification/src/server/NotificationInstruction.ts @@ -14,7 +14,13 @@ import { Processor, Instruction, JOB_STATUS, FlowNodeModel } from '@nocobase/plu export default class extends Instruction { async run(node: FlowNodeModel, prevJob, processor: Processor) { const options = processor.getParsedValue(node.config, node.id); - const sendParams = { channelName: options.channelName, message: options, triggerFrom: 'workflow' }; + const scope = processor.getScope(node.id); + const sendParams = { + channelName: options.channelName, + message: { ...options, content: node.config.content }, + triggerFrom: 'workflow', + data: scope, + }; const notificationServer = this.workflow.pm.get(NotificationsServerPlugin) as NotificationsServerPlugin; const { workflow } = processor.execution;