@mysetup/nodemailer 1.5.0 → 1.5.1

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;AAqCjE,eAAO,MAAM,iBAAiB,GAC1B,MAAM,cAAc,EACpB,QAAQ,YAAY,gCA4CvB,CAAC"}
@@ -75,18 +75,28 @@ var sendMail = function (mailOptions, env) {
75
75
  };
76
76
  var connectNodeMailer = function (data, config) { return __awaiter(void 0, void 0, void 0, function () {
77
77
  var templatePath, htmlTemplate, mailOptions, env, error_1;
78
- return __generator(this, function (_a) {
79
- switch (_a.label) {
78
+ var _a;
79
+ return __generator(this, function (_b) {
80
+ switch (_b.label) {
80
81
  case 0:
81
- _a.trys.push([0, 3, , 4]);
82
+ _b.trys.push([0, 3, , 4]);
82
83
  templatePath = node_path_1.default.join(__dirname, "views", "".concat(data.template, ".ejs"));
83
84
  return [4 /*yield*/, ejs_1.default.renderFile(templatePath, data.value)];
84
85
  case 1:
85
- htmlTemplate = _a.sent();
86
+ htmlTemplate = _b.sent();
86
87
  mailOptions = {
87
88
  to: data.toEmail,
88
89
  subject: data.subject,
89
90
  html: htmlTemplate,
91
+ attachments: (_a = data.attachments) === null || _a === void 0 ? void 0 : _a.map(function (attachment) { return ({
92
+ filename: attachment.filename,
93
+ content: attachment.content,
94
+ path: attachment.path,
95
+ contentType: attachment.contentType,
96
+ contentDisposition: attachment.contentDisposition,
97
+ headers: attachment.headers,
98
+ raw: attachment.raw,
99
+ }); }),
90
100
  };
91
101
  env = {
92
102
  user: config.user,
@@ -96,9 +106,9 @@ var connectNodeMailer = function (data, config) { return __awaiter(void 0, void
96
106
  return [4 /*yield*/, sendMail(mailOptions, env)];
97
107
  case 2:
98
108
  // Send email
99
- return [2 /*return*/, _a.sent()];
109
+ return [2 /*return*/, _b.sent()];
100
110
  case 3:
101
- error_1 = _a.sent();
111
+ error_1 = _b.sent();
102
112
  logger_1.logger.error(error_1);
103
113
  return [3 /*break*/, 4];
104
114
  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.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "files": [