diff --git a/src/main/java/com/gxwebsoft/common/system/util/EmailTemplateUtil.java b/src/main/java/com/gxwebsoft/common/system/util/EmailTemplateUtil.java index f442cc4..10957e3 100644 --- a/src/main/java/com/gxwebsoft/common/system/util/EmailTemplateUtil.java +++ b/src/main/java/com/gxwebsoft/common/system/util/EmailTemplateUtil.java @@ -208,8 +208,18 @@ public class EmailTemplateUtil { if (email == null || email.trim().isEmpty()) { return; } - String title = "邮箱验证码"; - String content = "您正在绑定或修改邮箱,验证码为:" + code + ",5 分钟内有效,请勿泄露给他人。如非本人操作,请忽略此邮件。"; - sendNotificationEmail(title, content, email, tenantId, "尊敬的用户", "验证码用于确认邮箱真实性,请勿转发给他人。", null, null); + // 标题直接带上验证码,手机通知预览/邮件列表一眼可见 + String title = "【WebSoft】邮箱验证码:" + code; + try { + Map data = new HashMap<>(); + data.put("code", code); + data.put("sendTime", DateUtil.now()); + + emailRecordService.sendHtmlEmail(title, "captcha.html", data, new String[]{email}); + } catch (Exception e) { + // 如果HTML邮件发送失败,降级为文本邮件(标题仍含验证码) + String content = "【WebSoft】邮箱验证码\r\n\r\n您的验证码:" + code + "\r\n\r\n5 分钟内有效,请勿泄露给他人。如非本人操作,请忽略此邮件。"; + emailRecordService.sendEmail(title, content, email, tenantId); + } } } diff --git a/src/main/resources/templates/captcha.html b/src/main/resources/templates/captcha.html new file mode 100644 index 0000000..137002d --- /dev/null +++ b/src/main/resources/templates/captcha.html @@ -0,0 +1,219 @@ + + + + + + WebSoft 邮箱验证码 + + + +
+
+ +
+ +
+ + +

邮箱验证码

+

您正在绑定或修改邮箱,请使用下方验证码完成验证。

+ + +
+
您的验证码
+
${code!}
+
⏱ 5 分钟内有效,请尽快使用
+
+ + +
+
验证码用于确认邮箱真实性
+
+ 请将验证码输入到注册或修改邮箱页面以完成操作。验证码仅对当前请求有效,过期后请重新获取。 +
+
+ + +
+
安全提示
+
+ • 验证码请勿转发或告诉他人,WebSoft 工作人员不会向您索取。
+ • 如非本人操作,请忽略此邮件,您的账号仍然安全。
+ • 多次未收到验证码可在客户端重新申请。 +
+
+ + +
+ 发送时间:${sendTime!} +
+ + + +
+
+ + diff --git a/src/main/resources/templates/notification.html b/src/main/resources/templates/notification.html index affb1d4..88de0e3 100644 --- a/src/main/resources/templates/notification.html +++ b/src/main/resources/templates/notification.html @@ -3,257 +3,209 @@ - WebSoft通知 + WebSoft - 系统通知 -
- -
- -
企业级数字化解决方案
-
📢
+
+
+
+
- -
-

${title!'系统通知'}

-

- ${greeting!'您好!'}我们有一条重要通知需要告知您,请查看以下详细信息。 -

+

${title!'系统通知'}

+

${greeting!'您好!'}我们有一条重要通知需要告知您,请查看以下详细信息。

- -
-

📋 通知详情

-
- ${content!'这是一条系统通知消息。'} -
-
- - - <% if(has(infoMessage)) { %> -
- ℹ️ 温馨提示: ${infoMessage!} -
- <% } %> - - - <% if(has(actionUrl)) { %> - - <% } %> - - -
- 发送时间:${sendTime!} -
+ +
+
通知详情
+
${content!'这是一条系统通知消息。'}
- + + <% if(has(infoMessage)) { %> +
+
温馨提示
+
    +
  • ${infoMessage!}
  • +
+
+ <% } %> + + + <% if(has(actionUrl)) { %> + +
如按钮未生效,请将上面的链接复制到浏览器打开。
+ <% } %> + + +
发送时间:${sendTime!}
+
+
diff --git a/src/main/resources/templates/password-reset.html b/src/main/resources/templates/password-reset.html index 5d13a39..a83d743 100644 --- a/src/main/resources/templates/password-reset.html +++ b/src/main/resources/templates/password-reset.html @@ -3,320 +3,287 @@ - WebSoft密码重置 + WebSoft - 密码重置 -