@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.
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +3 -3
- package/package.json +1 -1
package/dist/server/index.d.ts
CHANGED
|
@@ -213,8 +213,8 @@ declare function createSendEmail({ transporter, config, }: {
|
|
|
213
213
|
};
|
|
214
214
|
}): (options: SendEmailOptions) => Promise<any>;
|
|
215
215
|
|
|
216
|
-
declare function createRenderEmailTemplate({
|
|
217
|
-
|
|
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
|
|
package/dist/server/index.js
CHANGED
|
@@ -668,7 +668,7 @@ function applyReplacements(html, replacements, logger) {
|
|
|
668
668
|
});
|
|
669
669
|
}
|
|
670
670
|
function createRenderEmailTemplate({
|
|
671
|
-
|
|
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
|
-
{
|
|
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
|
|
690
|
+
error
|
|
691
691
|
});
|
|
692
692
|
throw new Error(`Email template error: ${templateKey}`);
|
|
693
693
|
}
|