@builder6/email 3.0.9 → 3.0.10
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.
|
@@ -32,7 +32,7 @@ let EmailController = class EmailController {
|
|
|
32
32
|
text,
|
|
33
33
|
html,
|
|
34
34
|
});
|
|
35
|
-
return { message: '
|
|
35
|
+
return { message: 'Email sent successfully' };
|
|
36
36
|
}
|
|
37
37
|
catch (error) {
|
|
38
38
|
console.error('Query error', error);
|
|
@@ -58,9 +58,9 @@ let EmailController = class EmailController {
|
|
|
58
58
|
html,
|
|
59
59
|
headers,
|
|
60
60
|
attachments,
|
|
61
|
-
mailComposer
|
|
61
|
+
mailComposer,
|
|
62
62
|
});
|
|
63
|
-
return { message: '
|
|
63
|
+
return { message: 'Email sent successfully' };
|
|
64
64
|
}
|
|
65
65
|
catch (error) {
|
|
66
66
|
console.error('Query error', error);
|
|
@@ -92,38 +92,41 @@ exports.EmailController = EmailController;
|
|
|
92
92
|
__decorate([
|
|
93
93
|
(0, common_1.Post)('send'),
|
|
94
94
|
(0, swagger_1.ApiOperation)({
|
|
95
|
-
summary: '
|
|
96
|
-
description: '
|
|
95
|
+
summary: 'Send mail',
|
|
96
|
+
description: 'Send mail by providing recipient email, subject, and content',
|
|
97
97
|
}),
|
|
98
98
|
(0, swagger_1.ApiBody)({
|
|
99
|
-
description: '
|
|
99
|
+
description: 'Parameters required to send mail',
|
|
100
100
|
schema: {
|
|
101
101
|
type: 'object',
|
|
102
102
|
properties: {
|
|
103
103
|
from: {
|
|
104
104
|
type: 'string',
|
|
105
105
|
example: 'example@example.com',
|
|
106
|
-
description: '接收邮件的邮箱地址',
|
|
107
106
|
},
|
|
108
107
|
to: {
|
|
109
108
|
type: 'string',
|
|
110
109
|
example: 'example@example.com',
|
|
111
|
-
|
|
110
|
+
},
|
|
111
|
+
cc: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
example: 'example@example.com',
|
|
114
|
+
},
|
|
115
|
+
bcc: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
example: 'example@example.com',
|
|
112
118
|
},
|
|
113
119
|
subject: {
|
|
114
120
|
type: 'string',
|
|
115
|
-
example: '
|
|
116
|
-
description: '邮件主题',
|
|
121
|
+
example: 'This is subject',
|
|
117
122
|
},
|
|
118
123
|
text: {
|
|
119
124
|
type: 'string',
|
|
120
|
-
example: '
|
|
121
|
-
description: '邮件的纯文本内容',
|
|
125
|
+
example: 'This is a test email',
|
|
122
126
|
},
|
|
123
127
|
html: {
|
|
124
128
|
type: 'string',
|
|
125
|
-
example: '<h1
|
|
126
|
-
description: '邮件的 HTML 格式内容',
|
|
129
|
+
example: '<h1>This is HTML content</h1>',
|
|
127
130
|
},
|
|
128
131
|
},
|
|
129
132
|
required: ['from', 'to', 'subject'],
|
|
@@ -143,11 +146,11 @@ __decorate([
|
|
|
143
146
|
__decorate([
|
|
144
147
|
(0, common_1.Post)('sendMailToUsers'),
|
|
145
148
|
(0, swagger_1.ApiOperation)({
|
|
146
|
-
summary: '
|
|
147
|
-
description: '
|
|
149
|
+
summary: 'Send mail to multiple users',
|
|
150
|
+
description: 'Send mail by providing a list of recipient IDs, subject, and content',
|
|
148
151
|
}),
|
|
149
152
|
(0, swagger_1.ApiBody)({
|
|
150
|
-
description: '
|
|
153
|
+
description: 'Parameters required to send mail',
|
|
151
154
|
schema: {
|
|
152
155
|
type: 'object',
|
|
153
156
|
properties: {
|
|
@@ -159,7 +162,7 @@ __decorate([
|
|
|
159
162
|
fromUserId: {
|
|
160
163
|
type: 'string',
|
|
161
164
|
example: '67505d5f84ff2b0b4fc245b9',
|
|
162
|
-
description: '
|
|
165
|
+
description: 'Sender user id',
|
|
163
166
|
},
|
|
164
167
|
toUserIds: {
|
|
165
168
|
type: 'array',
|
|
@@ -167,7 +170,7 @@ __decorate([
|
|
|
167
170
|
type: 'string',
|
|
168
171
|
},
|
|
169
172
|
example: ['675b95f987d0d8467f525e91', '6756c5be07e329d0106cdd36'],
|
|
170
|
-
description: '
|
|
173
|
+
description: 'Recipient user ids',
|
|
171
174
|
},
|
|
172
175
|
ccUserIds: {
|
|
173
176
|
type: 'array',
|
|
@@ -175,7 +178,7 @@ __decorate([
|
|
|
175
178
|
type: 'string',
|
|
176
179
|
},
|
|
177
180
|
example: ['675b95f987d0d8467f525e91', '6756c5be07e329d0106cdd36'],
|
|
178
|
-
description: '
|
|
181
|
+
description: 'CC user ids',
|
|
179
182
|
},
|
|
180
183
|
bccUserIds: {
|
|
181
184
|
type: 'array',
|
|
@@ -183,43 +186,43 @@ __decorate([
|
|
|
183
186
|
type: 'string',
|
|
184
187
|
},
|
|
185
188
|
example: ['675b95f987d0d8467f525e91', '6756c5be07e329d0106cdd36'],
|
|
186
|
-
description: '
|
|
189
|
+
description: 'BCC user ids',
|
|
187
190
|
},
|
|
188
191
|
replyToUserId: {
|
|
189
192
|
type: 'string',
|
|
190
193
|
example: '67505d5f84ff2b0b4fc245b9',
|
|
191
|
-
description: '
|
|
194
|
+
description: 'Reply to user id',
|
|
192
195
|
},
|
|
193
196
|
subject: {
|
|
194
197
|
type: 'string',
|
|
195
|
-
example: '
|
|
196
|
-
description: '
|
|
198
|
+
example: 'Hello from Steedos',
|
|
199
|
+
description: 'Email subject',
|
|
197
200
|
},
|
|
198
201
|
text: {
|
|
199
202
|
type: 'string',
|
|
200
|
-
example: '
|
|
201
|
-
description: '
|
|
203
|
+
example: 'This is a test email',
|
|
204
|
+
description: 'Email plain text content',
|
|
202
205
|
},
|
|
203
206
|
html: {
|
|
204
207
|
type: 'string',
|
|
205
|
-
example: '<h1
|
|
206
|
-
description: '
|
|
208
|
+
example: '<h1>This is HTML content</h1>',
|
|
209
|
+
description: 'Email HTML content',
|
|
207
210
|
},
|
|
208
211
|
headers: {
|
|
209
212
|
type: 'object',
|
|
210
|
-
description: '
|
|
213
|
+
description: 'Custom headers',
|
|
211
214
|
},
|
|
212
215
|
attachments: {
|
|
213
216
|
type: 'array',
|
|
214
217
|
items: {
|
|
215
|
-
type: 'object'
|
|
218
|
+
type: 'object',
|
|
216
219
|
},
|
|
217
|
-
description: '
|
|
220
|
+
description: 'Attachment list',
|
|
218
221
|
},
|
|
219
222
|
mailComposer: {
|
|
220
223
|
type: 'object',
|
|
221
|
-
description: 'MailComposer
|
|
222
|
-
}
|
|
224
|
+
description: 'MailComposer object',
|
|
225
|
+
},
|
|
223
226
|
},
|
|
224
227
|
required: ['spaceId', 'toUserIds', 'subject'],
|
|
225
228
|
},
|
|
@@ -243,10 +246,10 @@ __decorate([
|
|
|
243
246
|
__decorate([
|
|
244
247
|
(0, common_1.Patch)('config'),
|
|
245
248
|
(0, swagger_1.ApiOperation)({
|
|
246
|
-
summary: '
|
|
249
|
+
summary: 'Set email parameters',
|
|
247
250
|
}),
|
|
248
251
|
(0, swagger_1.ApiBody)({
|
|
249
|
-
description: '
|
|
252
|
+
description: 'Parameters required to send mail',
|
|
250
253
|
schema: {
|
|
251
254
|
type: 'object',
|
|
252
255
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.controller.js","sourceRoot":"","sources":["../../src/email/email.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0E;AAC1E,6CAAwD;AACxD,yCAA4C;AAC5C,mDAA+C;AAIxC,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"email.controller.js","sourceRoot":"","sources":["../../src/email/email.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0E;AAC1E,6CAAwD;AACxD,yCAA4C;AAC5C,mDAA+C;AAIxC,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IA4CrD,AAAN,KAAK,CAAC,SAAS,CACC,IAAY,EACd,EAAU,EACV,EAAU,EACT,GAAW,EACP,O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AAC,CAAA;IACf,WAAA,IAAA,aAAI,EAAC,MAAM,CAAC,CAAA;IACZ,WAAA,IAAA,aAAI,EAAC,MAAM,CAAC,CAAA;IACZ,WAAA,IAAA,aAAI,EAAC,SAAS,CAAC,CAAA;IACf,YAAA,IAAA,aAAI,EAAC,aAAa,CAAC,CAAA;IACnB,YAAA,IAAA,aAAI,EAAC,cAAc,CAAC,CAAA;;;;sDA2BtB;AAYK;IAVL,IAAA,cAAK,EAAC,QAAQ,CAAC;IACf,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,sBAAsB;KAChC,CAAC;IACD,IAAA,iBAAO,EAAC;QACP,WAAW,EAAE,kCAAkC;QAC/C,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;SACf;KACF,CAAC;IACkB,WAAA,IAAA,aAAI,GAAE,CAAA;;;;mDAazB;0BAhOU,eAAe;IAF3B,IAAA,kBAAS,EAAC,iBAAU,CAAC;IACrB,IAAA,mBAAU,EAAC,cAAc,CAAC;qCAEkB,4BAAY;GAD5C,eAAe,CAiO3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder6/email",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.10",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -12,16 +12,22 @@
|
|
|
12
12
|
"build:watch": "rimraf dist && tsc --watch"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@builder6/core": "3.0.9",
|
|
16
15
|
"bluebird": "^3.7.2",
|
|
17
16
|
"email-addresses": "^5.0.0",
|
|
18
17
|
"lodash": "^4.17.5",
|
|
19
18
|
"nodemailer": "^6.9.16"
|
|
20
19
|
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@builder6/core": "3.0.9",
|
|
22
|
+
"@builder6/moleculer": "3.0.9",
|
|
23
|
+
"@nestjs/common": "^11.0.0",
|
|
24
|
+
"@nestjs/core": "^11.0.0",
|
|
25
|
+
"@nestjs/swagger": "^11.0.7"
|
|
26
|
+
},
|
|
21
27
|
"publishConfig": {
|
|
22
28
|
"access": "public"
|
|
23
29
|
},
|
|
24
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "4151e07b946953c7742ee3b70a86c0827fb779bb",
|
|
25
31
|
"devDependencies": {
|
|
26
32
|
"@types/bluebird": "^3.5.42"
|
|
27
33
|
}
|