vintasend-pug 0.4.0 → 0.4.3
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.
|
@@ -2,10 +2,16 @@ import type { BaseEmailTemplateRenderer, EmailTemplate } from 'vintasend/dist/se
|
|
|
2
2
|
import type { JsonObject } from 'vintasend/dist/types/json-values';
|
|
3
3
|
import type { DatabaseNotification } from 'vintasend/dist/types/notification';
|
|
4
4
|
import type { BaseNotificationTypeConfig } from 'vintasend/dist/types/notification-type-config';
|
|
5
|
+
import type { BaseLogger } from 'vintasend/dist/services/loggers/base-logger';
|
|
5
6
|
import pug from 'pug';
|
|
6
7
|
export declare class PugEmailTemplateRenderer<Config extends BaseNotificationTypeConfig> implements BaseEmailTemplateRenderer<Config> {
|
|
7
8
|
private options;
|
|
9
|
+
private logger;
|
|
8
10
|
constructor(options: pug.Options);
|
|
11
|
+
/**
|
|
12
|
+
* Inject logger (called by VintaSend when logger exists)
|
|
13
|
+
*/
|
|
14
|
+
injectLogger(logger: BaseLogger): void;
|
|
9
15
|
render(notification: DatabaseNotification<Config>, context: JsonObject): Promise<EmailTemplate>;
|
|
10
16
|
}
|
|
11
17
|
export declare class PugEmailTemplateRendererFactory<Config extends BaseNotificationTypeConfig> {
|
|
@@ -8,6 +8,13 @@ const pug_1 = __importDefault(require("pug"));
|
|
|
8
8
|
class PugEmailTemplateRenderer {
|
|
9
9
|
constructor(options) {
|
|
10
10
|
this.options = options;
|
|
11
|
+
this.logger = null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Inject logger (called by VintaSend when logger exists)
|
|
15
|
+
*/
|
|
16
|
+
injectLogger(logger) {
|
|
17
|
+
this.logger = logger;
|
|
11
18
|
}
|
|
12
19
|
async render(notification, context) {
|
|
13
20
|
const bodyTemplate = pug_1.default.compileFile(notification.bodyTemplate, this.options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vintasend-pug",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"pug": "^3.0.3",
|
|
18
|
-
"vintasend": "^0.4.
|
|
18
|
+
"vintasend": "^0.4.3"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/jest": "^29.5.14",
|