@nocobase/plugin-workflow-mailer 1.2.9-alpha → 1.2.11-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/externalVersion.js
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"@formily/antd-v5": "1.1.9",
|
|
12
|
-
"@nocobase/client": "1.2.
|
|
13
|
-
"@nocobase/plugin-workflow": "1.2.
|
|
12
|
+
"@nocobase/client": "1.2.11-alpha",
|
|
13
|
+
"@nocobase/plugin-workflow": "1.2.11-alpha",
|
|
14
14
|
"react-i18next": "11.18.6",
|
|
15
|
-
"@nocobase/server": "1.2.
|
|
15
|
+
"@nocobase/server": "1.2.11-alpha"
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"nodemailer","version":"6.9.13","description":"Easy as cake e-mail sending from your Node.js applications","main":"lib/nodemailer.js","scripts":{"test":"node --test --test-concurrency=1 test/**/*.test.js test/**/*-test.js","test:coverage":"c8 node --test --test-concurrency=1 test/**/*.test.js test/**/*-test.js","lint":"eslint .","update":"rm -rf node_modules/ package-lock.json && ncu -u && npm install"},"repository":{"type":"git","url":"https://github.com/nodemailer/nodemailer.git"},"keywords":["Nodemailer"],"author":"Andris Reinman","license":"MIT-0","bugs":{"url":"https://github.com/nodemailer/nodemailer/issues"},"homepage":"https://nodemailer.com/","devDependencies":{"@aws-sdk/client-ses":"3.529.1","bunyan":"1.8.15","c8":"9.1.0","eslint":"8.57.0","eslint-config-nodemailer":"1.2.0","eslint-config-prettier":"9.1.0","libbase64":"1.3.0","libmime":"5.3.4","libqp":"2.1.0","nodemailer-ntlm-auth":"1.0.4","proxy":"1.0.2","proxy-test-server":"1.0.0","smtp-server":"3.13.3"},"engines":{"node":">=6.0.0"},"_lastModified":"2024-06-
|
|
1
|
+
{"name":"nodemailer","version":"6.9.13","description":"Easy as cake e-mail sending from your Node.js applications","main":"lib/nodemailer.js","scripts":{"test":"node --test --test-concurrency=1 test/**/*.test.js test/**/*-test.js","test:coverage":"c8 node --test --test-concurrency=1 test/**/*.test.js test/**/*-test.js","lint":"eslint .","update":"rm -rf node_modules/ package-lock.json && ncu -u && npm install"},"repository":{"type":"git","url":"https://github.com/nodemailer/nodemailer.git"},"keywords":["Nodemailer"],"author":"Andris Reinman","license":"MIT-0","bugs":{"url":"https://github.com/nodemailer/nodemailer/issues"},"homepage":"https://nodemailer.com/","devDependencies":{"@aws-sdk/client-ses":"3.529.1","bunyan":"1.8.15","c8":"9.1.0","eslint":"8.57.0","eslint-config-nodemailer":"1.2.0","eslint-config-prettier":"9.1.0","libbase64":"1.3.0","libmime":"5.3.4","libqp":"2.1.0","nodemailer-ntlm-auth":"1.0.4","proxy":"1.0.2","proxy-test-server":"1.0.0","smtp-server":"3.13.3"},"engines":{"node":">=6.0.0"},"_lastModified":"2024-06-28T03:53:27.708Z"}
|
|
@@ -50,6 +50,7 @@ class MailerInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
50
50
|
to = [],
|
|
51
51
|
cc,
|
|
52
52
|
bcc,
|
|
53
|
+
subject,
|
|
53
54
|
html,
|
|
54
55
|
text,
|
|
55
56
|
ignoreFail,
|
|
@@ -59,12 +60,17 @@ class MailerInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
59
60
|
const sync = this.workflow.isWorkflowSync(workflow);
|
|
60
61
|
const transporter = import_nodemailer.default.createTransport(provider);
|
|
61
62
|
const send = (0, import_util.promisify)(transporter.sendMail.bind(transporter));
|
|
63
|
+
const payload = {
|
|
64
|
+
...options,
|
|
65
|
+
...contentType === "html" ? { html } : { text },
|
|
66
|
+
subject: subject == null ? void 0 : subject.trim(),
|
|
67
|
+
to: to.flat().map((item) => item == null ? void 0 : item.trim()).filter(Boolean),
|
|
68
|
+
cc: cc ? cc.flat().map((item) => item == null ? void 0 : item.trim()).filter(Boolean) : null,
|
|
69
|
+
bcc: bcc ? bcc.flat().map((item) => item == null ? void 0 : item.trim()).filter(Boolean) : null
|
|
70
|
+
};
|
|
62
71
|
if (sync) {
|
|
63
72
|
try {
|
|
64
|
-
const result = await send(
|
|
65
|
-
...options,
|
|
66
|
-
...contentType === "html" ? { html } : { text }
|
|
67
|
-
});
|
|
73
|
+
const result = await send(payload);
|
|
68
74
|
return {
|
|
69
75
|
status: import_plugin_workflow.JOB_STATUS.RESOLVED,
|
|
70
76
|
result
|
|
@@ -82,19 +88,14 @@ class MailerInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
82
88
|
nodeKey: node.key,
|
|
83
89
|
upstreamId: (prevJob == null ? void 0 : prevJob.id) ?? null
|
|
84
90
|
});
|
|
85
|
-
send({
|
|
86
|
-
...options,
|
|
87
|
-
...contentType === "html" ? { html } : { text },
|
|
88
|
-
to: to.flat().filter(Boolean),
|
|
89
|
-
cc: cc ? cc.flat().filter(Boolean) : null,
|
|
90
|
-
bcc: bcc ? bcc.flat().filter(Boolean) : null
|
|
91
|
-
}).then((response) => {
|
|
91
|
+
send(payload).then((response) => {
|
|
92
92
|
processor.logger.info(`smtp-mailer (#${node.id}) sent successfully.`);
|
|
93
93
|
job.set({
|
|
94
94
|
status: import_plugin_workflow.JOB_STATUS.RESOLVED,
|
|
95
95
|
result: response
|
|
96
96
|
});
|
|
97
97
|
}).catch((error) => {
|
|
98
|
+
processor.logger.warn(`smtp-mailer (#${node.id}) sent failed: ${error.message}`);
|
|
98
99
|
job.set({
|
|
99
100
|
status: import_plugin_workflow.JOB_STATUS.FAILED,
|
|
100
101
|
result: error
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "工作流:邮件发送节点",
|
|
5
5
|
"description": "Send email in workflow.",
|
|
6
6
|
"description.zh-CN": "可用于在工作流中发送电子邮件。",
|
|
7
|
-
"version": "1.2.
|
|
7
|
+
"version": "1.2.11-alpha",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/workflow-smtp-mailer",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@nocobase/server": "1.x",
|
|
22
22
|
"@nocobase/test": "1.x"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "251ff80e1ae6c0a9b4892fc6986dcdc0f5518fe8",
|
|
25
25
|
"keywords": [
|
|
26
26
|
"NocoBase",
|
|
27
27
|
"Workflow",
|