fix(email): complete mail settings and templates

This commit is contained in:
2026-09-04 12:06:42 +08:00
parent 4f8ab94fac
commit 4833053a5c
29 changed files with 716 additions and 426 deletions
+1 -58
View File
@@ -369,64 +369,7 @@ class GlobalSchema {
]],
],
],
'email' => [
'key' => 'email',
'title' => '邮件事件',
'version' => '2.0.0',
'option_key' => 'aksrt_settings',
'groups' => [
['key' => 'global', 'title' => '全局设置', 'fields' => [
['key' => 'email_footer_text', 'label' => '邮件页脚文字', 'type' => 'textarea', 'default' => ''],
['key' => 'email_site_branding', 'label' => '显示站点品牌', 'type' => 'switch', 'default' => true],
['key' => 'email_template_mode', 'label' => '邮件格式', 'type' => 'radio', 'default' => 'plain', 'options' => [
['label' => '纯文本', 'value' => 'plain'],
['label' => 'HTML', 'value' => 'html'],
]],
]],
['key' => 'branding', 'title' => '邮件品牌', 'fields' => [
['key' => 'mail_showname', 'label' => '发件人名称', 'type' => 'input', 'default' => '', 'help' => '覆盖系统默认发件人名称'],
['key' => 'mail_title_prefix', 'label' => '主题前缀', 'type' => 'input', 'default' => '', 'help' => '自动添加在所有邮件主题前面,如【站点名】'],
['key' => 'mail_description', 'label' => '邮件底部说明', 'type' => 'textarea', 'default' => '', 'help' => '附加在邮件页脚文字之后,留空不显示'],
['key' => 'mail_more_content', 'label' => '邮件附加内容', 'type' => 'textarea', 'default' => '', 'help' => '附加在邮件内容末尾的补充说明'],
]],
['key' => 'reg_verify_link', 'title' => '注册验证链接', 'fields' => [
['key' => 'email_reg_verify_link_enabled', 'label' => '启用', 'type' => 'switch', 'default' => true],
['key' => 'email_reg_verify_link_subject', 'label' => '主题', 'type' => 'input', 'default' => ''],
['key' => 'email_reg_verify_link_content', 'label' => '内容模板', 'type' => 'textarea', 'default' => ''],
['key' => 'email_reg_verify_link_html', 'label' => 'HTML 格式', 'type' => 'switch', 'default' => false],
]],
['key' => 'reg_verify_code', 'title' => '注册验证码', 'fields' => [
['key' => 'email_reg_verify_code_enabled', 'label' => '启用', 'type' => 'switch', 'default' => true],
['key' => 'email_reg_verify_code_subject', 'label' => '主题', 'type' => 'input', 'default' => ''],
['key' => 'email_reg_verify_code_content', 'label' => '内容模板', 'type' => 'textarea', 'default' => ''],
['key' => 'email_reg_verify_code_html', 'label' => 'HTML 格式', 'type' => 'switch', 'default' => false],
]],
['key' => 'reg_success', 'title' => '注册成功通知', 'fields' => [
['key' => 'email_reg_success_enabled', 'label' => '启用', 'type' => 'switch', 'default' => true],
['key' => 'email_reg_success_subject', 'label' => '主题', 'type' => 'input', 'default' => ''],
['key' => 'email_reg_success_content', 'label' => '内容模板', 'type' => 'textarea', 'default' => ''],
['key' => 'email_reg_success_html', 'label' => 'HTML 格式', 'type' => 'switch', 'default' => false],
]],
['key' => 'password_reset', 'title' => '密码重置', 'fields' => [
['key' => 'email_password_reset_enabled', 'label' => '启用', 'type' => 'switch', 'default' => true],
['key' => 'email_password_reset_subject', 'label' => '主题', 'type' => 'input', 'default' => ''],
['key' => 'email_password_reset_content', 'label' => '内容模板', 'type' => 'textarea', 'default' => ''],
['key' => 'email_password_reset_html', 'label' => 'HTML 格式', 'type' => 'switch', 'default' => false],
]],
['key' => 'change_code', 'title' => '邮箱变更验证码', 'fields' => [
['key' => 'email_change_code_enabled', 'label' => '启用', 'type' => 'switch', 'default' => true],
['key' => 'email_change_code_subject', 'label' => '主题', 'type' => 'input', 'default' => ''],
['key' => 'email_change_code_content', 'label' => '内容模板', 'type' => 'textarea', 'default' => ''],
['key' => 'email_change_code_html', 'label' => 'HTML 格式', 'type' => 'switch', 'default' => false],
]],
['key' => 'change_notice', 'title' => '邮箱变更通知', 'fields' => [
['key' => 'email_change_notice_enabled', 'label' => '启用', 'type' => 'switch', 'default' => true],
['key' => 'email_change_notice_subject', 'label' => '主题', 'type' => 'input', 'default' => ''],
['key' => 'email_change_notice_content', 'label' => '内容模板', 'type' => 'textarea', 'default' => ''],
['key' => 'email_change_notice_html', 'label' => 'HTML 格式', 'type' => 'switch', 'default' => false],
]],
],
],
'email' => \AKSRT\Settings\MailTemplates::build_schema(),
'custom-code' => [
'key' => 'custom-code',
'title' => '自定义代码',