mirror of
https://github.com/certd/certd.git
synced 2026-05-16 13:17:29 +08:00
chore: email template
This commit is contained in:
@@ -26,6 +26,7 @@ export class AutoZPrint {
|
||||
async init() {
|
||||
//监听https
|
||||
this.startHttpsServer();
|
||||
logger.info("ENV:", process.env.NODE_ENV);
|
||||
if (isDev()) {
|
||||
this.startHeapLog();
|
||||
}
|
||||
@@ -49,7 +50,7 @@ export class AutoZPrint {
|
||||
setInterval(() => {
|
||||
const mu = process.memoryUsage();
|
||||
logger.info(`rss:${format(mu.rss)},heapUsed: ${format(mu.heapUsed)},heapTotal: ${format(mu.heapTotal)},external: ${format(mu.external)}`);
|
||||
}, 60000);
|
||||
}, 20000);
|
||||
}
|
||||
|
||||
startHttpsServer() {
|
||||
|
||||
@@ -109,8 +109,14 @@ export class CodeService {
|
||||
|
||||
const code = randomNumber(verificationCodeLength);
|
||||
|
||||
const templateData = {
|
||||
code, duration, siteTitle
|
||||
}
|
||||
|
||||
const titleTemplate = opts?.title?
|
||||
|
||||
const title = `【${siteTitle}】${!!opts?.title ? opts.title : '验证码'}`;
|
||||
const content = !!opts.content ? this.compile(opts.content)({code, duration}) : `您的验证码是${code},请勿泄露`;
|
||||
const content = !!opts.content ? this.compile(opts.content)(templateData) : `您的验证码是${code},请勿泄露`;
|
||||
|
||||
await this.emailService.send({
|
||||
subject: title,
|
||||
|
||||
Reference in New Issue
Block a user