@travetto/email-nodemailer 5.0.0-rc.3 → 5.0.0-rc.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.
- package/package.json +2 -2
- package/src/nodemailer.ts +8 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/email-nodemailer",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.4",
|
|
4
4
|
"description": "Email transmission module.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"directory": "module/email-nodemailer"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@travetto/email": "^5.0.0-rc.
|
|
27
|
+
"@travetto/email": "^5.0.0-rc.4",
|
|
28
28
|
"@types/nodemailer": "^6.4.15",
|
|
29
29
|
"nodemailer": "^6.9.14"
|
|
30
30
|
},
|
package/src/nodemailer.ts
CHANGED
|
@@ -12,7 +12,13 @@ type Transport = TransportType | json.Options | smtp.Options | ses.Options | sen
|
|
|
12
12
|
* Nodemailer transport, takes in a transport factory as the input
|
|
13
13
|
*/
|
|
14
14
|
export class NodemailerTransport implements MailTransport {
|
|
15
|
-
#transport: Transporter
|
|
15
|
+
#transport: Transporter<SentEmail & {
|
|
16
|
+
envelope?: Record<string, string>;
|
|
17
|
+
accepted?: string[];
|
|
18
|
+
rejected?: string[];
|
|
19
|
+
pending?: string[];
|
|
20
|
+
response?: string;
|
|
21
|
+
}>;
|
|
16
22
|
|
|
17
23
|
/**
|
|
18
24
|
* Force content into alternative slots
|
|
@@ -37,15 +43,7 @@ export class NodemailerTransport implements MailTransport {
|
|
|
37
43
|
|
|
38
44
|
mail = this.#forceContentToAlternative(mail);
|
|
39
45
|
|
|
40
|
-
|
|
41
|
-
const res = await this.#transport.sendMail(mail) as {
|
|
42
|
-
messageId?: string;
|
|
43
|
-
envelope?: Record<string, string>;
|
|
44
|
-
accepted?: string[];
|
|
45
|
-
rejected?: string[];
|
|
46
|
-
pending?: string[];
|
|
47
|
-
response?: string;
|
|
48
|
-
};
|
|
46
|
+
const res = await this.#transport.sendMail(mail);
|
|
49
47
|
|
|
50
48
|
if (res.rejected?.length) {
|
|
51
49
|
console.error('Unable to send emails', { recipientCount: res.rejected?.length });
|