@maioradv/nestjs-core 1.3.3 → 1.3.4
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.
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { ConfigService } from "@nestjs/config";
|
|
2
2
|
import { SentMessageInfo, Transporter } from "nodemailer";
|
|
3
|
-
/** From email as email or ['From Name',email]
|
|
4
|
-
* @example user@email.com
|
|
5
|
-
* @example ['User Name','user@email.com']
|
|
6
|
-
*/
|
|
7
3
|
export type MailingAddress = string | [string, string];
|
|
8
|
-
export type ReceiverAddress =
|
|
4
|
+
export type ReceiverAddress = string | string[];
|
|
9
5
|
export declare class MailerService {
|
|
10
6
|
private readonly config;
|
|
11
7
|
readonly client: Transporter<SentMessageInfo>;
|
|
12
8
|
private sdkConfigs;
|
|
13
9
|
constructor(config: ConfigService);
|
|
14
10
|
sendMail({ from, to, subject, html, text, }: {
|
|
11
|
+
/** From email as email or ['From Name',email]
|
|
12
|
+
* @example 'user@email.com'
|
|
13
|
+
* @example ['User Name','user@email.com']
|
|
14
|
+
*/
|
|
15
15
|
from: MailingAddress;
|
|
16
|
+
/** From email as email or ['From Name',email]
|
|
17
|
+
* @example 'user@email.com'
|
|
18
|
+
* @example ['user1@email.com','user2@email.com']
|
|
19
|
+
*/
|
|
16
20
|
to: ReceiverAddress;
|
|
17
21
|
subject: string;
|
|
18
22
|
html: string;
|
|
@@ -24,7 +24,7 @@ let MailerService = class MailerService {
|
|
|
24
24
|
async sendMail({ from, to, subject, html, text, }) {
|
|
25
25
|
return this.client.sendMail({
|
|
26
26
|
from: Array.isArray(from) ? `"${from[0]}" <${from[1]}>` : from,
|
|
27
|
-
to:
|
|
27
|
+
to: Array.isArray(to) ? to.join(', ') : to,
|
|
28
28
|
subject,
|
|
29
29
|
text,
|
|
30
30
|
html,
|