feat: update email template

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2023-06-06 15:46:16 +08:00
parent 771d6c5cd5
commit a874c66b72
4 changed files with 13 additions and 5 deletions

View File

@@ -42,7 +42,7 @@ const defaultPostModelForRenderProps = {
export const baseRenderProps = Object.freeze({
author: defaultCommentModelForRenderProps.author,
link: defaultCommentModelForRenderProps.url,
link: 'https://innei.ren/note/122#comments-37ccbeec9c15bb0ddc51ca7d' as string,
mail: defaultCommentModelForRenderProps.mail,
text: defaultCommentModelForRenderProps.text,
title: '文章的标题' as string,

View File

@@ -335,7 +335,9 @@ export class CommentService implements OnModuleInit {
author:
type === CommentReplyMailType.Guest ? parent!.author : model.author,
master: masterInfo.name,
link: await this.resolveUrlByType(refType, refDoc),
link: await this.resolveUrlByType(refType, refDoc).then(
(url) => `${url}#comments-${model.id}`,
),
time: parsedTime,
mail:
CommentReplyMailType.Owner === type ? model.mail : masterInfo.mail,

View File

@@ -77,9 +77,13 @@ export class EmailService implements OnModuleInit, OnModuleDestroy {
}
async deleteTemplate(type: string) {
await this.assetService.removeUserCustomAsset(
`/email-template/${type}.template.ejs`,
)
await this.assetService
.removeUserCustomAsset(`/email-template/${type}.template.ejs`)
.catch((err) => {
if ((err?.message as string).includes('no such file or directory'))
return
throw err
})
}
teardown() {

View File

@@ -26,4 +26,6 @@ async function main() {
}
}
execSync('ln -s $PWD/assets $PWD/apps/core/assets ')
main()