@nestjs-modules/mailer 1.4.2 → 1.6.0

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.
Files changed (45) hide show
  1. package/.dockerignore +2 -2
  2. package/CHANGELOG.md +277 -196
  3. package/Dockerfile +10 -10
  4. package/LICENSE +20 -20
  5. package/README.md +66 -59
  6. package/dist/adapters/ejs.adapter.d.ts +9 -6
  7. package/dist/adapters/ejs.adapter.js +55 -35
  8. package/dist/adapters/handlebars.adapter.d.ts +10 -8
  9. package/dist/adapters/handlebars.adapter.js +70 -58
  10. package/dist/adapters/pug.adapter.d.ts +8 -5
  11. package/dist/adapters/pug.adapter.js +41 -27
  12. package/dist/constants/mailer.constant.d.ts +2 -0
  13. package/dist/constants/mailer.constant.js +5 -0
  14. package/dist/index.d.ts +8 -8
  15. package/dist/index.js +10 -10
  16. package/dist/interfaces/mailer-async-options.interface.d.ts +9 -9
  17. package/dist/interfaces/mailer-async-options.interface.js +2 -2
  18. package/dist/interfaces/mailer-options-factory.interface.d.ts +4 -4
  19. package/dist/interfaces/mailer-options-factory.interface.js +2 -2
  20. package/dist/interfaces/mailer-options.interface.d.ts +35 -35
  21. package/dist/interfaces/mailer-options.interface.js +2 -2
  22. package/dist/interfaces/mailer-send-mail-options.interface.d.ts +5 -5
  23. package/dist/interfaces/mailer-send-mail-options.interface.js +2 -2
  24. package/dist/interfaces/mailer-transport-factory.interface.d.ts +5 -0
  25. package/dist/{constants/mailer-options.constant.js → interfaces/mailer-transport-factory.interface.js} +2 -3
  26. package/dist/interfaces/send-mail-options.interface.d.ts +51 -48
  27. package/dist/interfaces/send-mail-options.interface.js +2 -2
  28. package/dist/interfaces/template-adapter-config.interface.d.ts +5 -0
  29. package/dist/interfaces/template-adapter-config.interface.js +2 -0
  30. package/dist/interfaces/template-adapter.interface.d.ts +4 -4
  31. package/dist/interfaces/template-adapter.interface.js +2 -2
  32. package/dist/mailer-core.module.d.ts +9 -9
  33. package/dist/mailer-core.module.js +73 -72
  34. package/dist/mailer-transport.factory.d.ts +8 -0
  35. package/dist/mailer-transport.factory.js +20 -0
  36. package/dist/mailer.module.d.ts +7 -7
  37. package/dist/mailer.module.js +29 -28
  38. package/dist/mailer.service.d.ts +13 -11
  39. package/dist/mailer.service.js +90 -83
  40. package/docker-compose.yml +18 -18
  41. package/index.d.ts +0 -0
  42. package/index.js +5 -5
  43. package/jest.config.js +17 -17
  44. package/package.json +100 -93
  45. package/dist/constants/mailer-options.constant.d.ts +0 -1
package/README.md CHANGED
@@ -1,59 +1,66 @@
1
- <p align="center">
2
- <a href="http://nestjs.com/" target="blank">
3
- <img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" />
4
- </a>
5
- </p>
6
-
7
- <p align="center">
8
- A mailer module for Nest framework (node.js) using <a href="https://nodemailer.com/">Nodemailer</a> library
9
- </p>
10
-
11
- <p align="center">
12
- <a href="https://www.npmjs.com/org/nestjs-modules"><img src="https://img.shields.io/npm/v/@nestjs-modules/mailer.svg" alt="NPM Version" /></a>
13
- <a href="https://www.npmjs.com/org/nestjs-modules"><img src="https://img.shields.io/npm/l/@nestjs-modules/mailer.svg" alt="Package License" /></a>
14
- <a href="https://www.npmjs.com/org/nestjs-modules"><img src="https://img.shields.io/npm/dm/@nestjs-modules/mailer.svg" alt="NPM Downloads" /></a>
15
- </p>
16
-
17
- ### Installation
18
-
19
- ```sh
20
- npm install --save @nestjs-modules/mailer nodemailer
21
- #or
22
- yarn add @nestjs-modules/mailer nodemailer
23
- ```
24
-
25
- **Hint:** handlebars and pug is an optional dependency, if you want to use the template, you must install it.
26
-
27
- #### with npm
28
- ```sh
29
- npm install --save handlebars
30
- #or
31
- npm install --save pug
32
- ```
33
-
34
- #### with yarn
35
- ```sh
36
- yarn add handlebars
37
- #or
38
- yarn add pug
39
- ```
40
-
41
- ### Documentation
42
-
43
- you can find all the documentation [here](https://nest-modules.github.io/mailer/) for the email module
44
-
45
- ### Starter kit
46
-
47
- - [Sending email-template with outlook](https://github.com/yanarp/nestjs-mailer) - Starter kit, nestjs mailer implementation on outlook smtp with email-template
48
-
49
- ### Contributing
50
-
51
- * [Cristiam Diaz](https://github.com/cdiaz)
52
- * [Eduardo Leal](https://github.com/eduardoleal)
53
- * [Juan Echeverry](https://github.com/juandav)
54
- * [Pat McGowan](https://github.com/p-mcgowan)
55
- * [Paweł Partyka](https://github.com/partyka95)
56
-
57
- ### License
58
-
59
- MIT
1
+ <p align="center">
2
+ <a href="http://nestjs.com/" target="blank">
3
+ <img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" />
4
+ </a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ A mailer module for Nest framework (node.js) using <a href="https://nodemailer.com/">Nodemailer</a> library
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/org/nestjs-modules"><img src="https://img.shields.io/npm/v/@nestjs-modules/mailer.svg" alt="NPM Version" /></a>
13
+ <a href="https://www.npmjs.com/org/nestjs-modules"><img src="https://img.shields.io/npm/l/@nestjs-modules/mailer.svg" alt="Package License" /></a>
14
+ <a href="https://www.npmjs.com/org/nestjs-modules"><img src="https://img.shields.io/npm/dm/@nestjs-modules/mailer.svg" alt="NPM Downloads" /></a>
15
+ <a href="https://opencollective.com/nest-modules#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
16
+ </p>
17
+
18
+ ### Installation
19
+
20
+ ```sh
21
+ npm install --save @nestjs-modules/mailer nodemailer
22
+ npm install --save-dev @types/nodemailer
23
+ #or
24
+ yarn add @nestjs-modules/mailer nodemailer
25
+ yarn add -D @types/nodemailer
26
+ ```
27
+
28
+ **Hint:** handlebars and pug is an optional dependency, if you want to use the template, you must install it.
29
+
30
+ #### with npm
31
+ ```sh
32
+ npm install --save handlebars
33
+ #or
34
+ npm install --save pug
35
+ #or
36
+ npm install --save ejs
37
+ ```
38
+
39
+ #### with yarn
40
+ ```sh
41
+ yarn add handlebars
42
+ #or
43
+ yarn add pug
44
+ #or
45
+ yarn add ejs
46
+ ```
47
+
48
+ ### Documentation
49
+
50
+ you can find all the documentation [here](https://nest-modules.github.io/mailer/) for the email module
51
+
52
+ ### Starter kit
53
+
54
+ - [Sending email-template with outlook](https://github.com/yanarp/nestjs-mailer) - Starter kit, nestjs mailer implementation on outlook smtp with email-template
55
+
56
+ ### Contributing
57
+
58
+ * [Cristiam Diaz](https://github.com/cdiaz)
59
+ * [Eduardo Leal](https://github.com/eduardoleal)
60
+ * [Juan Echeverry](https://github.com/juandav)
61
+ * [Pat McGowan](https://github.com/p-mcgowan)
62
+ * [Paweł Partyka](https://github.com/partyka95)
63
+
64
+ ### License
65
+
66
+ MIT
@@ -1,6 +1,9 @@
1
- import { MailerOptions } from '../interfaces/mailer-options.interface';
2
- import { TemplateAdapter } from '../interfaces/template-adapter.interface';
3
- export declare class EjsAdapter implements TemplateAdapter {
4
- private precompiledTemplates;
5
- compile(mail: any, callback: any, mailerOptions: MailerOptions): void;
6
- }
1
+ import { MailerOptions } from '../interfaces/mailer-options.interface';
2
+ import { TemplateAdapter } from '../interfaces/template-adapter.interface';
3
+ import { TemplateAdapterConfig } from '../interfaces/template-adapter-config.interface';
4
+ export declare class EjsAdapter implements TemplateAdapter {
5
+ private precompiledTemplates;
6
+ private config;
7
+ constructor(config?: TemplateAdapterConfig);
8
+ compile(mail: any, callback: any, mailerOptions: MailerOptions): void;
9
+ }
@@ -1,35 +1,55 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const ejs_1 = require("ejs");
4
- const lodash_1 = require("lodash");
5
- const fs = require("fs");
6
- const path = require("path");
7
- const inlineCss = require("inline-css");
8
- class EjsAdapter {
9
- constructor() {
10
- this.precompiledTemplates = {};
11
- }
12
- compile(mail, callback, mailerOptions) {
13
- const templateExt = path.extname(mail.data.template) || '.ejs';
14
- const templateName = path.basename(mail.data.template, path.extname(mail.data.template));
15
- const templateDir = path.dirname(mail.data.template) !== '.'
16
- ? path.dirname(mail.data.template)
17
- : lodash_1.get(mailerOptions, 'template.dir', '');
18
- const templatePath = path.join(templateDir, templateName + templateExt);
19
- if (!this.precompiledTemplates[templateName]) {
20
- try {
21
- const template = fs.readFileSync(templatePath, 'UTF-8');
22
- this.precompiledTemplates[templateName] = ejs_1.compile(template, lodash_1.get(mailerOptions, 'template.options', {}));
23
- }
24
- catch (err) {
25
- return callback(err);
26
- }
27
- }
28
- const rendered = this.precompiledTemplates[templateName](mail.data.context);
29
- inlineCss(rendered, { url: ' ' }).then((html) => {
30
- mail.data.html = html;
31
- return callback();
32
- });
33
- }
34
- }
35
- exports.EjsAdapter = EjsAdapter;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EjsAdapter = void 0;
4
+ const ejs_1 = require("ejs");
5
+ const lodash_1 = require("lodash");
6
+ const fs = require("fs");
7
+ const path = require("path");
8
+ const inlineCss = require("inline-css");
9
+ class EjsAdapter {
10
+ constructor(config) {
11
+ this.precompiledTemplates = {};
12
+ this.config = {
13
+ inlineCssOptions: { url: ' ' },
14
+ inlineCssEnabled: true,
15
+ };
16
+ Object.assign(this.config, config);
17
+ }
18
+ compile(mail, callback, mailerOptions) {
19
+ const templateExt = path.extname(mail.data.template) || '.ejs';
20
+ const templateName = path.basename(mail.data.template, path.extname(mail.data.template));
21
+ const templateDir = mail.data.template.startsWith('./')
22
+ ? lodash_1.get(mailerOptions, 'template.dir', '')
23
+ : path.dirname(mail.data.template);
24
+ const templatePath = path.join(templateDir, templateName + templateExt);
25
+ if (!this.precompiledTemplates[templateName]) {
26
+ try {
27
+ const template = fs.readFileSync(templatePath, 'UTF-8');
28
+ this.precompiledTemplates[templateName] = ejs_1.compile(template, Object.assign(Object.assign({}, lodash_1.get(mailerOptions, 'template.options', {})), { filename: templatePath }));
29
+ }
30
+ catch (err) {
31
+ return callback(err);
32
+ }
33
+ }
34
+ const rendered = this.precompiledTemplates[templateName](mail.data.context);
35
+ const render = (html) => {
36
+ if (this.config.inlineCssEnabled) {
37
+ inlineCss(html, this.config.inlineCssOptions).then((html) => {
38
+ mail.data.html = html;
39
+ return callback();
40
+ });
41
+ }
42
+ else {
43
+ mail.data.html = html;
44
+ return callback();
45
+ }
46
+ };
47
+ if (typeof rendered === 'string') {
48
+ render(rendered);
49
+ }
50
+ else {
51
+ rendered.then(render);
52
+ }
53
+ }
54
+ }
55
+ exports.EjsAdapter = EjsAdapter;
@@ -1,8 +1,10 @@
1
- import { HelperDeclareSpec } from 'handlebars';
2
- import { MailerOptions } from '../interfaces/mailer-options.interface';
3
- import { TemplateAdapter } from '../interfaces/template-adapter.interface';
4
- export declare class HandlebarsAdapter implements TemplateAdapter {
5
- private precompiledTemplates;
6
- constructor(helpers?: HelperDeclareSpec);
7
- compile(mail: any, callback: any, mailerOptions: MailerOptions): void;
8
- }
1
+ import { HelperDeclareSpec } from 'handlebars';
2
+ import { MailerOptions } from '../interfaces/mailer-options.interface';
3
+ import { TemplateAdapter } from '../interfaces/template-adapter.interface';
4
+ import { TemplateAdapterConfig } from '../interfaces/template-adapter-config.interface';
5
+ export declare class HandlebarsAdapter implements TemplateAdapter {
6
+ private precompiledTemplates;
7
+ private config;
8
+ constructor(helpers?: HelperDeclareSpec, config?: TemplateAdapterConfig);
9
+ compile(mail: any, callback: any, mailerOptions: MailerOptions): void;
10
+ }
@@ -1,58 +1,70 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs = require("fs");
4
- const path = require("path");
5
- const handlebars = require("handlebars");
6
- const inlineCss = require("inline-css");
7
- const glob = require("glob");
8
- const lodash_1 = require("lodash");
9
- class HandlebarsAdapter {
10
- constructor(helpers) {
11
- this.precompiledTemplates = {};
12
- handlebars.registerHelper('concat', (...args) => {
13
- args.pop();
14
- return args.join('');
15
- });
16
- handlebars.registerHelper(helpers || {});
17
- }
18
- compile(mail, callback, mailerOptions) {
19
- const precompile = (template, callback, options) => {
20
- const templateExt = path.extname(template) || '.hbs';
21
- const templateName = path.basename(template, path.extname(template));
22
- const templateDir = path.dirname(template) !== '.'
23
- ? path.dirname(template)
24
- : lodash_1.get(options, 'dir', '');
25
- const templatePath = path.join(templateDir, templateName + templateExt);
26
- if (!this.precompiledTemplates[templateName]) {
27
- try {
28
- const template = fs.readFileSync(templatePath, 'UTF-8');
29
- this.precompiledTemplates[templateName] = handlebars.compile(template, lodash_1.get(options, 'options', {}));
30
- }
31
- catch (err) {
32
- return callback(err);
33
- }
34
- }
35
- return {
36
- templateExt,
37
- templateName,
38
- templateDir,
39
- templatePath,
40
- };
41
- };
42
- const { templateName } = precompile(mail.data.template, callback, mailerOptions.template);
43
- const runtimeOptions = lodash_1.get(mailerOptions, 'options', {
44
- partials: false,
45
- data: {},
46
- });
47
- if (runtimeOptions.partials) {
48
- const files = glob.sync(path.join(runtimeOptions.partials.dir, '*.hbs'));
49
- files.forEach((file) => precompile(file, () => { }, runtimeOptions.partials));
50
- }
51
- const rendered = this.precompiledTemplates[templateName](mail.data.context, Object.assign(Object.assign({}, runtimeOptions), { partials: this.precompiledTemplates }));
52
- inlineCss(rendered, { url: ' ' }).then((html) => {
53
- mail.data.html = html;
54
- return callback();
55
- });
56
- }
57
- }
58
- exports.HandlebarsAdapter = HandlebarsAdapter;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HandlebarsAdapter = void 0;
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ const handlebars = require("handlebars");
7
+ const inlineCss = require("inline-css");
8
+ const glob = require("glob");
9
+ const lodash_1 = require("lodash");
10
+ class HandlebarsAdapter {
11
+ constructor(helpers, config) {
12
+ this.precompiledTemplates = {};
13
+ this.config = {
14
+ inlineCssOptions: { url: ' ' },
15
+ inlineCssEnabled: true,
16
+ };
17
+ handlebars.registerHelper('concat', (...args) => {
18
+ args.pop();
19
+ return args.join('');
20
+ });
21
+ handlebars.registerHelper(helpers || {});
22
+ Object.assign(this.config, config);
23
+ }
24
+ compile(mail, callback, mailerOptions) {
25
+ const precompile = (template, callback, options) => {
26
+ const templateExt = path.extname(template) || '.hbs';
27
+ const templateName = path.basename(template, path.extname(template));
28
+ const templateDir = template.startsWith('./')
29
+ ? lodash_1.get(options, 'dir', '')
30
+ : path.dirname(template);
31
+ const templatePath = path.join(templateDir, templateName + templateExt);
32
+ if (!this.precompiledTemplates[templateName]) {
33
+ try {
34
+ const template = fs.readFileSync(templatePath, 'UTF-8');
35
+ this.precompiledTemplates[templateName] = handlebars.compile(template, lodash_1.get(options, 'options', {}));
36
+ }
37
+ catch (err) {
38
+ return callback(err);
39
+ }
40
+ }
41
+ return {
42
+ templateExt,
43
+ templateName,
44
+ templateDir,
45
+ templatePath,
46
+ };
47
+ };
48
+ const { templateName } = precompile(mail.data.template, callback, mailerOptions.template);
49
+ const runtimeOptions = lodash_1.get(mailerOptions, 'options', {
50
+ partials: false,
51
+ data: {},
52
+ });
53
+ if (runtimeOptions.partials) {
54
+ const files = glob.sync(path.join(runtimeOptions.partials.dir, '*.hbs'));
55
+ files.forEach((file) => precompile(file, () => { }, runtimeOptions.partials));
56
+ }
57
+ const rendered = this.precompiledTemplates[templateName](mail.data.context, Object.assign(Object.assign({}, runtimeOptions), { partials: this.precompiledTemplates }));
58
+ if (this.config.inlineCssEnabled) {
59
+ inlineCss(rendered, this.config.inlineCssOptions).then((html) => {
60
+ mail.data.html = html;
61
+ return callback();
62
+ });
63
+ }
64
+ else {
65
+ mail.data.html = rendered;
66
+ return callback();
67
+ }
68
+ }
69
+ }
70
+ exports.HandlebarsAdapter = HandlebarsAdapter;
@@ -1,5 +1,8 @@
1
- import { MailerOptions } from '../interfaces/mailer-options.interface';
2
- import { TemplateAdapter } from '../interfaces/template-adapter.interface';
3
- export declare class PugAdapter implements TemplateAdapter {
4
- compile(mail: any, callback: any, mailerOptions: MailerOptions): void;
5
- }
1
+ import { MailerOptions } from '../interfaces/mailer-options.interface';
2
+ import { TemplateAdapter } from '../interfaces/template-adapter.interface';
3
+ import { TemplateAdapterConfig } from '../interfaces/template-adapter-config.interface';
4
+ export declare class PugAdapter implements TemplateAdapter {
5
+ private config;
6
+ constructor(config?: TemplateAdapterConfig);
7
+ compile(mail: any, callback: any, mailerOptions: MailerOptions): void;
8
+ }
@@ -1,27 +1,41 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const path = require("path");
4
- const lodash_1 = require("lodash");
5
- const pug_1 = require("pug");
6
- const inlineCss = require("inline-css");
7
- class PugAdapter {
8
- compile(mail, callback, mailerOptions) {
9
- const templateExt = path.extname(mail.data.template) || '.pug';
10
- const templateName = path.basename(mail.data.template, path.extname(mail.data.template));
11
- const templateDir = path.dirname(mail.data.template) !== '.'
12
- ? path.dirname(mail.data.template)
13
- : lodash_1.get(mailerOptions, 'template.dir', '');
14
- const templatePath = path.join(templateDir, templateName + templateExt);
15
- const options = Object.assign(Object.assign({}, mail.data.context), lodash_1.get(mailerOptions, 'template.options', {}));
16
- pug_1.renderFile(templatePath, options, (err, body) => {
17
- if (err) {
18
- return callback(err);
19
- }
20
- inlineCss(body, { url: ' ' }).then((html) => {
21
- mail.data.html = html;
22
- return callback();
23
- });
24
- });
25
- }
26
- }
27
- exports.PugAdapter = PugAdapter;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PugAdapter = void 0;
4
+ const path = require("path");
5
+ const lodash_1 = require("lodash");
6
+ const pug_1 = require("pug");
7
+ const inlineCss = require("inline-css");
8
+ class PugAdapter {
9
+ constructor(config) {
10
+ this.config = {
11
+ inlineCssOptions: { url: ' ' },
12
+ inlineCssEnabled: true,
13
+ };
14
+ Object.assign(this.config, config);
15
+ }
16
+ compile(mail, callback, mailerOptions) {
17
+ const templateExt = path.extname(mail.data.template) || '.pug';
18
+ const templateName = path.basename(mail.data.template, path.extname(mail.data.template));
19
+ const templateDir = mail.data.template.startsWith('./')
20
+ ? lodash_1.get(mailerOptions, 'template.dir', '')
21
+ : path.dirname(mail.data.template);
22
+ const templatePath = path.join(templateDir, templateName + templateExt);
23
+ const options = Object.assign(Object.assign({}, mail.data.context), lodash_1.get(mailerOptions, 'template.options', {}));
24
+ pug_1.renderFile(templatePath, options, (err, body) => {
25
+ if (err) {
26
+ return callback(err);
27
+ }
28
+ if (this.config.inlineCssEnabled) {
29
+ inlineCss(body, this.config.inlineCssOptions).then((html) => {
30
+ mail.data.html = html;
31
+ return callback();
32
+ });
33
+ }
34
+ else {
35
+ mail.data.html = body;
36
+ return callback();
37
+ }
38
+ });
39
+ }
40
+ }
41
+ exports.PugAdapter = PugAdapter;
@@ -0,0 +1,2 @@
1
+ export declare const MAILER_OPTIONS = "MAILER_OPTIONS";
2
+ export declare const MAILER_TRANSPORT_FACTORY = "MAILER_TRANSPORT_FACTORY";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAILER_TRANSPORT_FACTORY = exports.MAILER_OPTIONS = void 0;
4
+ exports.MAILER_OPTIONS = 'MAILER_OPTIONS';
5
+ exports.MAILER_TRANSPORT_FACTORY = 'MAILER_TRANSPORT_FACTORY';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { MailerModule } from './mailer.module';
2
- export { PugAdapter } from './adapters/pug.adapter';
3
- export { HandlebarsAdapter } from './adapters/handlebars.adapter';
4
- export { MailerOptions } from './interfaces/mailer-options.interface';
5
- export { TemplateAdapter } from './interfaces/template-adapter.interface';
6
- export { MailerOptionsFactory } from './interfaces/mailer-options-factory.interface';
7
- export { ISendMailOptions } from './interfaces/send-mail-options.interface';
8
- export { MailerService } from './mailer.service';
1
+ export { MailerModule } from './mailer.module';
2
+ export { MAILER_OPTIONS, MAILER_TRANSPORT_FACTORY, } from './constants/mailer.constant';
3
+ export { MailerOptions } from './interfaces/mailer-options.interface';
4
+ export { TemplateAdapter } from './interfaces/template-adapter.interface';
5
+ export { MailerOptionsFactory } from './interfaces/mailer-options-factory.interface';
6
+ export { ISendMailOptions } from './interfaces/send-mail-options.interface';
7
+ export { MailerTransportFactory } from './interfaces/mailer-transport-factory.interface';
8
+ export { MailerService } from './mailer.service';
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var mailer_module_1 = require("./mailer.module");
4
- exports.MailerModule = mailer_module_1.MailerModule;
5
- var pug_adapter_1 = require("./adapters/pug.adapter");
6
- exports.PugAdapter = pug_adapter_1.PugAdapter;
7
- var handlebars_adapter_1 = require("./adapters/handlebars.adapter");
8
- exports.HandlebarsAdapter = handlebars_adapter_1.HandlebarsAdapter;
9
- var mailer_service_1 = require("./mailer.service");
10
- exports.MailerService = mailer_service_1.MailerService;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MailerService = exports.MAILER_TRANSPORT_FACTORY = exports.MAILER_OPTIONS = exports.MailerModule = void 0;
4
+ var mailer_module_1 = require("./mailer.module");
5
+ Object.defineProperty(exports, "MailerModule", { enumerable: true, get: function () { return mailer_module_1.MailerModule; } });
6
+ var mailer_constant_1 = require("./constants/mailer.constant");
7
+ Object.defineProperty(exports, "MAILER_OPTIONS", { enumerable: true, get: function () { return mailer_constant_1.MAILER_OPTIONS; } });
8
+ Object.defineProperty(exports, "MAILER_TRANSPORT_FACTORY", { enumerable: true, get: function () { return mailer_constant_1.MAILER_TRANSPORT_FACTORY; } });
9
+ var mailer_service_1 = require("./mailer.service");
10
+ Object.defineProperty(exports, "MailerService", { enumerable: true, get: function () { return mailer_service_1.MailerService; } });
@@ -1,9 +1,9 @@
1
- import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
2
- import { MailerOptions } from './mailer-options.interface';
3
- import { MailerOptionsFactory } from './mailer-options-factory.interface';
4
- export interface MailerAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
5
- inject?: any[];
6
- useClass?: Type<MailerOptionsFactory>;
7
- useExisting?: Type<MailerOptionsFactory>;
8
- useFactory?: (...args: any[]) => Promise<MailerOptions> | MailerOptions;
9
- }
1
+ import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
2
+ import { MailerOptions } from './mailer-options.interface';
3
+ import { MailerOptionsFactory } from './mailer-options-factory.interface';
4
+ export interface MailerAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
5
+ inject?: any[];
6
+ useClass?: Type<MailerOptionsFactory>;
7
+ useExisting?: Type<MailerOptionsFactory>;
8
+ useFactory?: (...args: any[]) => Promise<MailerOptions> | MailerOptions;
9
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { MailerOptions } from './mailer-options.interface';
2
- export interface MailerOptionsFactory {
3
- createMailerOptions(): Promise<MailerOptions> | MailerOptions;
4
- }
1
+ import { MailerOptions } from './mailer-options.interface';
2
+ export interface MailerOptionsFactory {
3
+ createMailerOptions(): Promise<MailerOptions> | MailerOptions;
4
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });