@yimingliao/cms 0.0.47 → 0.0.48

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.
@@ -213,8 +213,8 @@ declare function createSendEmail({ transporter, config, }: {
213
213
  };
214
214
  }): (options: SendEmailOptions) => Promise<any>;
215
215
 
216
- declare function createRenderEmailTemplate({ storageUrl, logger, }: {
217
- storageUrl: string;
216
+ declare function createRenderEmailTemplate({ logoUrl, logger, }: {
217
+ logoUrl: string;
218
218
  logger: Logger;
219
219
  }): (templateKey: string, replacements?: Record<string, string>) => Promise<string>;
220
220
 
@@ -668,7 +668,7 @@ function applyReplacements(html, replacements, logger) {
668
668
  });
669
669
  }
670
670
  function createRenderEmailTemplate({
671
- storageUrl,
671
+ logoUrl,
672
672
  logger
673
673
  }) {
674
674
  return async function renderEmailTemplate(templateKey, replacements = {}) {
@@ -678,7 +678,7 @@ function createRenderEmailTemplate({
678
678
  let contentHtml = await readTemplate(contentPath);
679
679
  contentHtml = applyReplacements(
680
680
  contentHtml,
681
- { STORAGE_URL: storageUrl, ...replacements },
681
+ { LOGO_URL: logoUrl, ...replacements },
682
682
  logger
683
683
  );
684
684
  return layoutHtml.replaceAll("{{{content}}}", contentHtml);
@@ -687,7 +687,7 @@ function createRenderEmailTemplate({
687
687
  msg: "Email template render failed",
688
688
  templateKey,
689
689
  templateDir: TEMPLATE_DIR,
690
- error: error instanceof Error ? error.stack : error
690
+ error
691
691
  });
692
692
  throw new Error(`Email template error: ${templateKey}`);
693
693
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yimingliao/cms",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "author": "Yiming Liao",
5
5
  "license": "MIT",
6
6
  "type": "module",