feat: add password reset functionality with email templates

This commit is contained in:
shiyu
2025-11-06 15:31:13 +08:00
parent ba62bd0d4a
commit 4e724b9c4a
21 changed files with 1643 additions and 7 deletions
+102
View File
@@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<title>Foxel 密码重置</title>
<style>
body {
background: #f4f7fb;
font-family: 'Helvetica Neue', Arial, sans-serif;
margin: 0;
padding: 32px 0;
color: #1f2937;
}
.wrapper {
max-width: 560px;
margin: 0 auto;
}
.card {
background: #ffffff;
border-radius: 16px;
box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
overflow: hidden;
border: 1px solid rgba(99, 102, 241, 0.12);
}
.header {
background: linear-gradient(120deg, #4f46e5, #7c3aed);
padding: 32px;
color: #ffffff;
}
.header h1 {
margin: 0;
font-size: 24px;
letter-spacing: 0.2px;
}
.content {
padding: 32px;
}
.content p {
margin: 16px 0;
line-height: 1.6;
}
.cta {
display: block;
margin: 32px 0;
text-align: center;
}
.cta a {
display: inline-block;
background: linear-gradient(120deg, #6366f1, #8b5cf6);
color: #ffffff;
text-decoration: none;
padding: 14px 32px;
border-radius: 999px;
font-weight: 600;
box-shadow: 0 8px 24px rgba(79, 70, 229, 0.32);
}
.info-box {
background: #f5f3ff;
border: 1px solid rgba(107, 114, 128, 0.1);
border-radius: 12px;
padding: 18px;
margin-top: 16px;
}
.footer {
padding: 24px 32px;
font-size: 12px;
color: #6b7280;
line-height: 1.6;
background: #fafafa;
border-top: 1px solid rgba(15, 23, 42, 0.04);
}
.footer a {
color: #6366f1;
text-decoration: none;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="card">
<div class="header">
<h1>重置你的 Foxel 密码</h1>
</div>
<div class="content">
<p>你好,${username}。</p>
<p>我们收到了重置你 Foxel 帐号密码的请求。请点击下方按钮完成密码重置操作:</p>
<div class="cta">
<a href="${reset_link}" target="_blank" rel="noopener">重置密码</a>
</div>
<p>如果按钮无法点击,你也可以复制下面的链接到浏览器打开:</p>
<div class="info-box">
<div style="word-break: break-all;">${reset_link}</div>
</div>
<p>该链接在 ${expire_minutes} 分钟内有效。若你未发起此请求,请忽略本邮件,你的密码不会发生变化。</p>
</div>
<div class="footer">
<div>此邮件由 Foxel 系统自动发送,请勿直接回复。</div>
</div>
</div>
</div>
</body>
</html>
+97
View File
@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<title>Foxel 邮件配置测试</title>
<style>
body {
margin: 0;
padding: 32px 0;
background: linear-gradient(135deg, #eef2ff, #e0f2fe);
font-family: 'Helvetica Neue', Arial, sans-serif;
color: #0f172a;
}
.wrapper {
max-width: 560px;
margin: 0 auto;
}
.card {
background: #ffffff;
border-radius: 18px;
overflow: hidden;
box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
border: 1px solid rgba(99, 102, 241, 0.08);
}
.banner {
background: linear-gradient(120deg, #1d4ed8, #6366f1);
padding: 36px;
color: #ffffff;
letter-spacing: 0.2px;
}
.banner h1 {
margin: 0;
font-size: 24px;
}
.content {
padding: 32px;
line-height: 1.7;
}
.badge {
display: inline-block;
padding: 6px 14px;
border-radius: 999px;
background: rgba(59, 130, 246, 0.12);
color: #1d4ed8;
font-weight: 600;
font-size: 13px;
margin-bottom: 16px;
}
.cta-box {
margin-top: 32px;
padding: 20px;
border-radius: 14px;
background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(14, 165, 233, 0.08));
border: 1px solid rgba(99, 102, 241, 0.12);
}
.cta-box strong {
display: block;
margin-bottom: 8px;
font-size: 16px;
}
.footer {
padding: 24px 32px;
background: #f8fafc;
font-size: 12px;
color: #64748b;
border-top: 1px solid rgba(148, 163, 184, 0.18);
}
</style>
</head>
<body>
<div class="wrapper">
<div class="card">
<div class="banner">
<h1>Foxel 邮件服务已连通</h1>
</div>
<div class="content">
<div class="badge">Mail Delivery Test</div>
<p>你好,${username}</p>
<p>
这是一封来自 <strong>Foxel</strong> 的测试邮件。如果你能够正常阅读到这段内容,说明系统已经成功与配置的邮箱服务建立连接。
</p>
<div class="cta-box">
<strong>接下来可以做什么?</strong>
<ul style="margin: 0; padding-left: 18px; line-height: 1.7;">
<li>继续完善系统通知、密码重置等业务功能</li>
<li>在后台页面中自定义更精美的邮件模板</li>
<li>保持发送凭据安全,避免泄露</li>
</ul>
</div>
</div>
<div class="footer">
本邮件由 Foxel 系统自动发送,请勿直接回复。如非本人操作,请忽略此邮件。
</div>
</div>
</div>
</body>
</html>