vintasend-react-email 1.0.0-alpha4 → 1.0.0-alpha5

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":"react-email-inline-template-renderer.d.ts","sourceRoot":"","sources":["../src/react-email-inline-template-renderer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EACzB,UAAU,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,UAAU,EACX,MAAM,WAAW,CAAC;AAWnB,qBAAa,gCAAgC,CAAC,MAAM,SAAS,0BAA0B,CACrF,YAAW,yBAAyB,CAAC,MAAM,CAAC;IAE5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,MAAM,EAAE,UAAU,GAAG,IAAI,CAAQ;gBAErB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAItD,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAIhC,MAAM,CACV,YAAY,EAAE,oBAAoB,CAAC,MAAM,CAAC,EAC1C,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,aAAa,CAAC;IAyCnB,yBAAyB,CAC7B,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,EACrC,eAAe,EAAE,oBAAoB,EACrC,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,aAAa,CAAC;YA2BX,wBAAwB;YAwBxB,8BAA8B;IAqB5C,OAAO,CAAC,wBAAwB;IAmBhC,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,qBAAqB;YAMf,gBAAgB;IAQ9B,OAAO,CAAC,mBAAmB;CAO5B;AAED,qBAAa,uCAAuC,CAAC,MAAM,SAAS,0BAA0B;IAC5F,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAGlD"}
1
+ {"version":3,"file":"react-email-inline-template-renderer.d.ts","sourceRoot":"","sources":["../src/react-email-inline-template-renderer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EACzB,UAAU,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,UAAU,EACX,MAAM,WAAW,CAAC;AAYnB,qBAAa,gCAAgC,CAAC,MAAM,SAAS,0BAA0B,CACrF,YAAW,yBAAyB,CAAC,MAAM,CAAC;IAE5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,MAAM,EAAE,UAAU,GAAG,IAAI,CAAQ;gBAErB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAItD,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAIhC,MAAM,CACV,YAAY,EAAE,oBAAoB,CAAC,MAAM,CAAC,EAC1C,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,aAAa,CAAC;IA2CnB,yBAAyB,CAC7B,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,EACrC,eAAe,EAAE,oBAAoB,EACrC,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,aAAa,CAAC;YA2BX,wBAAwB;YAwBxB,8BAA8B;IAqB5C,OAAO,CAAC,wBAAwB;IAmBhC,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,qBAAqB;YAMf,gBAAgB;IAQ9B,OAAO,CAAC,mBAAmB;CAO5B;AAED,qBAAa,uCAAuC,CAAC,MAAM,SAAS,0BAA0B;IAC5F,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAGlD"}
@@ -5,6 +5,7 @@ import { dirname, join } from 'node:path';
5
5
  import { pathToFileURL } from 'node:url';
6
6
  import { render as renderReactEmail } from '@react-email/render';
7
7
  import { transform } from 'esbuild';
8
+ import { log, logId } from 'vintasend';
8
9
  const COMPILED_TEMPLATE_CACHE_DIR = join(tmpdir(), 'vintasend-react-email-inline-templates');
9
10
  export class ReactEmailInlineTemplateRenderer {
10
11
  constructor(generatedTemplates) {
@@ -15,7 +16,7 @@ export class ReactEmailInlineTemplateRenderer {
15
16
  this.logger = logger;
16
17
  }
17
18
  async render(notification, context) {
18
- this.logger?.info(`Rendering inline email template for notification ${notification.id}`);
19
+ this.logger?.info(log `Rendering inline email template for notification ${logId(notification.id)}`);
19
20
  const bodyTemplateKey = notification.bodyTemplate;
20
21
  if (!bodyTemplateKey) {
21
22
  throw new Error('Body template is required');
@@ -42,7 +43,7 @@ export class ReactEmailInlineTemplateRenderer {
42
43
  };
43
44
  }
44
45
  async renderFromTemplateContent(notification, templateContent, context) {
45
- this.logger?.info(`Rendering inline email template from content for notification ${notification.id}`);
46
+ this.logger?.info(log `Rendering inline email template from content for notification ${logId(notification.id)}`);
46
47
  if (!templateContent.subject) {
47
48
  throw new Error('Subject template is required');
48
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"react-email-template-renderer.d.ts","sourceRoot":"","sources":["../src/react-email-template-renderer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EACzB,UAAU,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,UAAU,EACX,MAAM,WAAW,CAAC;AAYnB,qBAAa,0BAA0B,CAAC,MAAM,SAAS,0BAA0B,CAC/E,YAAW,yBAAyB,CAAC,MAAM,CAAC;IAE5C,MAAM,EAAE,UAAU,GAAG,IAAI,CAAQ;IAEjC,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAIhC,MAAM,CACV,YAAY,EAAE,oBAAoB,CAAC,MAAM,CAAC,EAC1C,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,aAAa,CAAC;IAoBnB,yBAAyB,CAC7B,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,EACrC,eAAe,EAAE,oBAAoB,EACrC,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,aAAa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0B;IACtF,MAAM;CAGP"}
@@ -5,6 +5,7 @@ import { dirname, extname, join } from 'node:path';
5
5
  import { pathToFileURL } from 'node:url';
6
6
  import { render as renderReactEmail } from '@react-email/render';
7
7
  import { transform } from 'esbuild';
8
+ import { log, logId } from 'vintasend';
8
9
  const TS_TEMPLATE_EXTENSIONS = new Set(['.ts', '.tsx', '.mts', '.cts']);
9
10
  const COMPILED_TEMPLATE_CACHE_DIR = join(tmpdir(), 'vintasend-react-email-templates');
10
11
  export class ReactEmailTemplateRenderer {
@@ -15,10 +16,10 @@ export class ReactEmailTemplateRenderer {
15
16
  this.logger = logger;
16
17
  }
17
18
  async render(notification, context) {
18
- this.logger?.info(`Rendering email template for notification ${notification.id}`);
19
+ this.logger?.info(log `Rendering email template for notification ${logId(notification.id)}`);
19
20
  const bodyTemplateFactory = await this.loadTemplateFactory(notification.bodyTemplate);
20
21
  if (!notification.subjectTemplate) {
21
- this.logger?.info('Subject template missing');
22
+ this.logger?.info(log `Subject template missing`);
22
23
  throw new Error('Subject template is required');
23
24
  }
24
25
  const subjectTemplateFactory = await this.loadTemplateFactory(notification.subjectTemplate);
@@ -30,9 +31,9 @@ export class ReactEmailTemplateRenderer {
30
31
  };
31
32
  }
32
33
  async renderFromTemplateContent(notification, templateContent, context) {
33
- this.logger?.info(`Rendering email template from content for notification ${notification.id}`);
34
+ this.logger?.info(log `Rendering email template from content for notification ${logId(notification.id)}`);
34
35
  if (!templateContent.subject) {
35
- this.logger?.info('Subject template content missing');
36
+ this.logger?.info(log `Subject template content missing`);
36
37
  throw new Error('Subject template is required');
37
38
  }
38
39
  const subjectTemplateFactory = await this.loadTemplateFactoryFromContent(templateContent.subject, 'subject');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vintasend-react-email",
3
- "version": "1.0.0-alpha4",
3
+ "version": "1.0.0-alpha5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/vintasoftware/vintasend-react-email.git"
@@ -33,7 +33,7 @@
33
33
  "esbuild": "^0.25.11",
34
34
  "react": "^19.2.0",
35
35
  "react-dom": "^19.2.0",
36
- "vintasend": "^1.0.0-alpha4"
36
+ "vintasend": "^1.0.0-alpha5"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@biomejs/biome": "^2.5.10",