@lenne.tech/nest-server 11.1.7 → 11.1.9
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/core/common/decorators/unified-field.decorator.js +1 -1
- package/dist/core/common/decorators/unified-field.decorator.js.map +1 -1
- package/dist/core/common/services/email.service.d.ts +2 -0
- package/dist/core/common/services/email.service.js +3 -2
- package/dist/core/common/services/email.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/core/common/decorators/unified-field.decorator.ts +1 -1
- package/src/core/common/services/email.service.ts +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.9",
|
|
4
4
|
"description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type SMTPPool = require('nodemailer/lib/smtp-pool');
|
|
2
|
+
|
|
1
3
|
import { Injectable } from '@nestjs/common';
|
|
2
4
|
import nodemailer = require('nodemailer');
|
|
3
5
|
import { Attachment } from 'nodemailer/lib/mailer';
|
|
@@ -31,15 +33,17 @@ export class EmailService {
|
|
|
31
33
|
htmlTemplate?: string;
|
|
32
34
|
senderEmail?: string;
|
|
33
35
|
senderName?: string;
|
|
36
|
+
smtp?: SMTPPool | SMTPPool.Options;
|
|
34
37
|
templateData?: { [key: string]: any };
|
|
35
38
|
text?: string;
|
|
36
39
|
textTemplate?: string;
|
|
37
40
|
},
|
|
38
41
|
): Promise<any> {
|
|
39
42
|
// Process config
|
|
40
|
-
const { attachments, htmlTemplate, senderEmail, senderName, templateData, textTemplate } = {
|
|
43
|
+
const { attachments, htmlTemplate, senderEmail, senderName, smtp, templateData, textTemplate } = {
|
|
41
44
|
senderEmail: this.configService.getFastButReadOnly('email.defaultSender.email'),
|
|
42
45
|
senderName: this.configService.getFastButReadOnly('email.defaultSender.name'),
|
|
46
|
+
smtp: config.smtp || this.configService.get('email.smtp'),
|
|
43
47
|
...config,
|
|
44
48
|
};
|
|
45
49
|
|
|
@@ -71,7 +75,7 @@ export class EmailService {
|
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
// Init transporter
|
|
74
|
-
const transporter = nodemailer.createTransport(
|
|
78
|
+
const transporter = nodemailer.createTransport(smtp);
|
|
75
79
|
|
|
76
80
|
// Send mail
|
|
77
81
|
return transporter.sendMail({
|