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 10931b6..c96c339 100644 --- a/src/main/java/com/gxwebsoft/common/system/util/EmailTemplateUtil.java +++ b/src/main/java/com/gxwebsoft/common/system/util/EmailTemplateUtil.java @@ -37,7 +37,9 @@ public class EmailTemplateUtil { data.put("username", username); data.put("phone", phone); data.put("password", password); - data.put("email", email); + if (email != null && !email.trim().isEmpty()) { + data.put("email", email); + } emailRecordService.sendHtmlEmail(title, "register-success.html", data, new String[]{email}); } catch (Exception e) { @@ -62,8 +64,10 @@ public class EmailTemplateUtil { Map data = new HashMap<>(); data.put("username", username); data.put("phone", phone); - data.put("newPassword", newPassword); data.put("resetTime", DateUtil.now()); + if (newPassword != null && !newPassword.trim().isEmpty()) { + data.put("newPassword", newPassword); + } emailRecordService.sendHtmlEmail(title, "password-reset.html", data, new String[]{email}); } catch (Exception e) { @@ -93,16 +97,16 @@ public class EmailTemplateUtil { data.put("content", content); data.put("sendTime", DateUtil.now()); - if (greeting != null) { + if (greeting != null && !greeting.trim().isEmpty()) { data.put("greeting", greeting); } - if (infoMessage != null) { + if (infoMessage != null && !infoMessage.trim().isEmpty()) { data.put("infoMessage", infoMessage); } - if (actionUrl != null) { + if (actionUrl != null && !actionUrl.trim().isEmpty()) { data.put("actionUrl", actionUrl); } - if (actionText != null) { + if (actionText != null && !actionText.trim().isEmpty()) { data.put("actionText", actionText); } diff --git a/src/main/resources/templates/notification.html b/src/main/resources/templates/notification.html index 083d0ba..48f19f5 100644 --- a/src/main/resources/templates/notification.html +++ b/src/main/resources/templates/notification.html @@ -10,41 +10,41 @@ padding: 0; box-sizing: border-box; } - + body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; line-height: 1.6; color: #333; background-color: #f5f5f5; } - + .email-container { max-width: 600px; margin: 0 auto; background-color: #ffffff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } - + .header { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); padding: 40px 30px; text-align: center; color: white; } - + .logo { font-size: 32px; font-weight: bold; margin-bottom: 10px; letter-spacing: 2px; } - + .header-subtitle { font-size: 16px; opacity: 0.9; margin-bottom: 20px; } - + .notification-icon { width: 60px; height: 60px; @@ -56,25 +56,25 @@ justify-content: center; font-size: 30px; } - + .content { padding: 40px 30px; } - + .title { font-size: 24px; color: #333; margin-bottom: 20px; text-align: center; } - + .message { font-size: 16px; color: #666; margin-bottom: 30px; line-height: 1.8; } - + .notification-content { background-color: #f8f9fa; border-radius: 8px; @@ -82,23 +82,23 @@ margin: 30px 0; border-left: 4px solid #4facfe; } - + .notification-content h3 { color: #333; margin-bottom: 15px; font-size: 18px; } - + .notification-body { color: #555; line-height: 1.8; } - + .cta-section { text-align: center; margin: 40px 0; } - + .cta-button { display: inline-block; background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); @@ -111,12 +111,12 @@ transition: transform 0.2s ease; box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4); } - + .cta-button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(79, 172, 254, 0.6); } - + .info-box { background-color: #e3f2fd; border: 1px solid #bbdefb; @@ -125,37 +125,37 @@ margin: 20px 0; color: #1565c0; } - + .info-box strong { color: #0d47a1; } - + .footer { background-color: #2c3e50; color: #ecf0f1; padding: 30px; text-align: center; } - + .footer-content { margin-bottom: 20px; } - + .footer-links { margin: 20px 0; } - + .footer-links a { color: #3498db; text-decoration: none; margin: 0 15px; font-size: 14px; } - + .footer-links a:hover { text-decoration: underline; } - + .copyright { font-size: 12px; color: #95a5a6; @@ -163,7 +163,7 @@ padding-top: 20px; border-top: 1px solid #34495e; } - + .timestamp { text-align: right; font-size: 12px; @@ -172,21 +172,21 @@ padding-top: 15px; border-top: 1px solid #eee; } - + @media (max-width: 600px) { .email-container { margin: 0; box-shadow: none; } - + .header, .content, .footer { padding: 20px; } - + .logo { font-size: 24px; } - + .title { font-size: 20px; } @@ -201,14 +201,14 @@
企业级数字化解决方案
📢
- +

${title!'系统通知'}

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

- +

📋 通知详情

@@ -216,40 +216,40 @@ ${content!'这是一条系统通知消息。'}
- + - <% if(infoMessage!) { %> + <% if(has(infoMessage)) { %>
ℹ️ 温馨提示: ${infoMessage!}
<% } %> - + - <% if(actionUrl!) { %> + <% if(has(actionUrl)) { %>
${actionText!'查看详情'}
<% } %> - +
发送时间:${sendTime!}
- + - + diff --git a/src/main/resources/templates/register-success.html b/src/main/resources/templates/register-success.html index 718aa00..42b2bed 100644 --- a/src/main/resources/templates/register-success.html +++ b/src/main/resources/templates/register-success.html @@ -10,41 +10,41 @@ padding: 0; box-sizing: border-box; } - + body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; line-height: 1.6; color: #333; background-color: #f5f5f5; } - + .email-container { max-width: 600px; margin: 0 auto; background-color: #ffffff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } - + .header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 40px 30px; text-align: center; color: white; } - + .logo { font-size: 32px; font-weight: bold; margin-bottom: 10px; letter-spacing: 2px; } - + .header-subtitle { font-size: 16px; opacity: 0.9; margin-bottom: 20px; } - + .success-icon { width: 60px; height: 60px; @@ -56,18 +56,18 @@ justify-content: center; font-size: 30px; } - + .content { padding: 40px 30px; } - + .welcome-title { font-size: 24px; color: #333; margin-bottom: 20px; text-align: center; } - + .welcome-message { font-size: 16px; color: #666; @@ -75,7 +75,7 @@ text-align: center; line-height: 1.8; } - + .account-info { background-color: #f8f9fa; border-radius: 8px; @@ -83,13 +83,13 @@ margin: 30px 0; border-left: 4px solid #667eea; } - + .account-info h3 { color: #333; margin-bottom: 15px; font-size: 18px; } - + .info-item { display: flex; justify-content: space-between; @@ -97,17 +97,17 @@ padding: 10px 0; border-bottom: 1px solid #e9ecef; } - + .info-item:last-child { border-bottom: none; } - + .info-label { font-weight: 600; color: #555; min-width: 80px; } - + .info-value { color: #333; font-family: 'Courier New', monospace; @@ -116,12 +116,12 @@ border-radius: 4px; border: 1px solid #ddd; } - + .cta-section { text-align: center; margin: 40px 0; } - + .cta-button { display: inline-block; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); @@ -134,78 +134,78 @@ transition: transform 0.2s ease; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); } - + .cta-button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6); } - + .features { margin: 40px 0; } - + .features h3 { text-align: center; margin-bottom: 25px; color: #333; } - + .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; } - + .feature-item { text-align: center; padding: 20px; background-color: #f8f9fa; border-radius: 8px; } - + .feature-icon { font-size: 24px; margin-bottom: 10px; } - + .feature-title { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 5px; } - + .feature-desc { font-size: 12px; color: #666; } - + .footer { background-color: #2c3e50; color: #ecf0f1; padding: 30px; text-align: center; } - + .footer-content { margin-bottom: 20px; } - + .footer-links { margin: 20px 0; } - + .footer-links a { color: #3498db; text-decoration: none; margin: 0 15px; font-size: 14px; } - + .footer-links a:hover { text-decoration: underline; } - + .copyright { font-size: 12px; color: #95a5a6; @@ -213,7 +213,7 @@ padding-top: 20px; border-top: 1px solid #34495e; } - + .security-notice { background-color: #fff3cd; border: 1px solid #ffeaa7; @@ -222,29 +222,29 @@ margin: 20px 0; color: #856404; } - + .security-notice strong { color: #533f03; } - + @media (max-width: 600px) { .email-container { margin: 0; box-shadow: none; } - + .header, .content, .footer { padding: 20px; } - + .logo { font-size: 24px; } - + .welcome-title { font-size: 20px; } - + .feature-grid { grid-template-columns: 1fr; } @@ -259,14 +259,14 @@
企业级数字化解决方案
- +

恭喜!账号注册成功

欢迎加入WebSoft大家庭!您的账号已成功创建,现在可以开始体验我们的企业级服务了。

- + - <% if(email!) { %> + <% if(has(email)) { %>
邮箱: ${email!}
<% } %>
- +
🔒 安全提醒: 请妥善保管您的登录信息,建议首次登录后立即修改密码。
- +
立即登录体验
- +

🚀 开始探索WebSoft的强大功能

@@ -327,20 +327,20 @@
- +