feat(邮件通知): 添加可自定义的邮件模板功能

支持在后台设置中配置管理员通知和回复通知的邮件模板
添加默认模板和恢复默认模板功能
更新相关API以支持模板的存储和使用
This commit is contained in:
anghunk
2026-01-20 16:03:38 +08:00
parent 4a4349e0b9
commit eaebda76a8
5 changed files with 385 additions and 161 deletions

View File

@@ -184,10 +184,12 @@ app.put('/admin/settings/email-notify', async (c) => {
const globalEnabled =
typeof body.globalEnabled === 'boolean' ? body.globalEnabled : undefined;
const smtp = body.smtp && typeof body.smtp === 'object' ? body.smtp : undefined;
const templates = body.templates && typeof body.templates === 'object' ? body.templates : undefined;
await saveEmailNotificationSettings(c.env, {
globalEnabled,
smtp
smtp,
templates
});
return c.json({ message: '保存成功' });