@mysetup/nodemailer 1.5.0 → 1.5.2

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 +1 @@
1
- {"version":3,"file":"nodemailer.d.ts","sourceRoot":"","sources":["../nodemailer.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAqCjE,eAAO,MAAM,iBAAiB,SACpB,cAAc,UACZ,YAAY,gCAgCvB,CAAC"}
1
+ {"version":3,"file":"nodemailer.d.ts","sourceRoot":"","sources":["../nodemailer.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAyCjE,eAAO,MAAM,iBAAiB,GAC1B,MAAM,cAAc,EACpB,QAAQ,YAAY,gCA4CvB,CAAC"}
@@ -56,6 +56,10 @@ var sendMail = function (mailOptions, env) {
56
56
  user: env.user,
57
57
  pass: env.pass,
58
58
  },
59
+ tls: {
60
+ // :point_down: this skips cert verification
61
+ rejectUnauthorized: false,
62
+ },
59
63
  }, {
60
64
  from: env.from,
61
65
  });
@@ -75,18 +79,28 @@ var sendMail = function (mailOptions, env) {
75
79
  };
76
80
  var connectNodeMailer = function (data, config) { return __awaiter(void 0, void 0, void 0, function () {
77
81
  var templatePath, htmlTemplate, mailOptions, env, error_1;
78
- return __generator(this, function (_a) {
79
- switch (_a.label) {
82
+ var _a;
83
+ return __generator(this, function (_b) {
84
+ switch (_b.label) {
80
85
  case 0:
81
- _a.trys.push([0, 3, , 4]);
86
+ _b.trys.push([0, 3, , 4]);
82
87
  templatePath = node_path_1.default.join(__dirname, "views", "".concat(data.template, ".ejs"));
83
88
  return [4 /*yield*/, ejs_1.default.renderFile(templatePath, data.value)];
84
89
  case 1:
85
- htmlTemplate = _a.sent();
90
+ htmlTemplate = _b.sent();
86
91
  mailOptions = {
87
92
  to: data.toEmail,
88
93
  subject: data.subject,
89
94
  html: htmlTemplate,
95
+ attachments: (_a = data.attachments) === null || _a === void 0 ? void 0 : _a.map(function (attachment) { return ({
96
+ filename: attachment.filename,
97
+ content: attachment.content,
98
+ path: attachment.path,
99
+ contentType: attachment.contentType,
100
+ contentDisposition: attachment.contentDisposition,
101
+ headers: attachment.headers,
102
+ raw: attachment.raw,
103
+ }); }),
90
104
  };
91
105
  env = {
92
106
  user: config.user,
@@ -96,9 +110,9 @@ var connectNodeMailer = function (data, config) { return __awaiter(void 0, void
96
110
  return [4 /*yield*/, sendMail(mailOptions, env)];
97
111
  case 2:
98
112
  // Send email
99
- return [2 /*return*/, _a.sent()];
113
+ return [2 /*return*/, _b.sent()];
100
114
  case 3:
101
- error_1 = _a.sent();
115
+ error_1 = _b.sent();
102
116
  logger_1.logger.error(error_1);
103
117
  return [3 /*break*/, 4];
104
118
  case 4: return [2 /*return*/];
@@ -1,3 +1,4 @@
1
+ import { type Readable } from "node:stream";
1
2
  export interface SendEmailEnv {
2
3
  user: string;
3
4
  pass: string;
@@ -8,5 +9,18 @@ export interface SendEmailInput {
8
9
  toEmail: string;
9
10
  template: string;
10
11
  value: JSON;
12
+ attachments?: {
13
+ filename?: string;
14
+ content?: string | Buffer | Readable;
15
+ path?: string;
16
+ href?: string;
17
+ httpHeaders?: object;
18
+ contentType?: string;
19
+ contentDisposition?: string;
20
+ cid?: string;
21
+ encoding?: string;
22
+ headers?: object;
23
+ raw?: string | Buffer | Readable;
24
+ }[];
11
25
  }
12
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC;CACf"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC;IACZ,WAAW,CAAC,EAAE;QACV,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;QACrC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;KACpC,EAAE,CAAC;CACP"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mysetup/nodemailer",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "prettier": "@mysetup/prettier-config",
41
41
  "engines": {
42
- "node": ">=18.0.0"
42
+ "node": ">=20.15.1"
43
43
  },
44
44
  "packageManager": "pnpm@9.9.0"
45
45
  }