@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.
- package/.dockerignore +2 -2
- package/CHANGELOG.md +277 -196
- package/Dockerfile +10 -10
- package/LICENSE +20 -20
- package/README.md +66 -59
- package/dist/adapters/ejs.adapter.d.ts +9 -6
- package/dist/adapters/ejs.adapter.js +55 -35
- package/dist/adapters/handlebars.adapter.d.ts +10 -8
- package/dist/adapters/handlebars.adapter.js +70 -58
- package/dist/adapters/pug.adapter.d.ts +8 -5
- package/dist/adapters/pug.adapter.js +41 -27
- package/dist/constants/mailer.constant.d.ts +2 -0
- package/dist/constants/mailer.constant.js +5 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +10 -10
- package/dist/interfaces/mailer-async-options.interface.d.ts +9 -9
- package/dist/interfaces/mailer-async-options.interface.js +2 -2
- package/dist/interfaces/mailer-options-factory.interface.d.ts +4 -4
- package/dist/interfaces/mailer-options-factory.interface.js +2 -2
- package/dist/interfaces/mailer-options.interface.d.ts +35 -35
- package/dist/interfaces/mailer-options.interface.js +2 -2
- package/dist/interfaces/mailer-send-mail-options.interface.d.ts +5 -5
- package/dist/interfaces/mailer-send-mail-options.interface.js +2 -2
- package/dist/interfaces/mailer-transport-factory.interface.d.ts +5 -0
- package/dist/{constants/mailer-options.constant.js → interfaces/mailer-transport-factory.interface.js} +2 -3
- package/dist/interfaces/send-mail-options.interface.d.ts +51 -48
- package/dist/interfaces/send-mail-options.interface.js +2 -2
- package/dist/interfaces/template-adapter-config.interface.d.ts +5 -0
- package/dist/interfaces/template-adapter-config.interface.js +2 -0
- package/dist/interfaces/template-adapter.interface.d.ts +4 -4
- package/dist/interfaces/template-adapter.interface.js +2 -2
- package/dist/mailer-core.module.d.ts +9 -9
- package/dist/mailer-core.module.js +73 -72
- package/dist/mailer-transport.factory.d.ts +8 -0
- package/dist/mailer-transport.factory.js +20 -0
- package/dist/mailer.module.d.ts +7 -7
- package/dist/mailer.module.js +29 -28
- package/dist/mailer.service.d.ts +13 -11
- package/dist/mailer.service.js +90 -83
- package/docker-compose.yml +18 -18
- package/index.d.ts +0 -0
- package/index.js +5 -5
- package/jest.config.js +17 -17
- package/package.json +100 -93
- 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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
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
|
-
|
|
4
|
-
|
|
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
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { MailerModule } from './mailer.module';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports
|
|
9
|
-
var mailer_service_1 = require("./mailer.service");
|
|
10
|
-
exports
|
|
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 });
|