fix: 邮件格式
This commit is contained in:
parent
b61da14fdd
commit
81df321782
@ -1,52 +1,124 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<meta name="description" content="email code">
|
<meta name="description" content="email code" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
</head>
|
</head>
|
||||||
<!--邮箱验证码模板-->
|
<!--邮箱验证码模板-->
|
||||||
<body>
|
<body>
|
||||||
<div style="background-color:#ECECEC; padding: 35px;">
|
<div style="background-color: #ececec; padding: 35px">
|
||||||
<table cellpadding="0" align="center"
|
<table
|
||||||
style="width: 800px;height: 100%; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family:微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial;background:#fff;">
|
cellpadding="0"
|
||||||
|
style="
|
||||||
|
width: 800px;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0px auto;
|
||||||
|
text-align: left;
|
||||||
|
position: relative;
|
||||||
|
border-top-left-radius: 5px;
|
||||||
|
border-top-right-radius: 5px;
|
||||||
|
border-bottom-right-radius: 5px;
|
||||||
|
border-bottom-left-radius: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: 微软雅黑, 黑体;
|
||||||
|
line-height: 1.5;
|
||||||
|
box-shadow: rgb(153, 153, 153) 0px 0px 5px;
|
||||||
|
border-collapse: collapse;
|
||||||
|
background-position: initial initial;
|
||||||
|
background-repeat: initial initial;
|
||||||
|
background: #fff;
|
||||||
|
"
|
||||||
|
>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th valign="middle"
|
<th
|
||||||
style="height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgba(51, 112, 255); background-color: rgba(51, 112, 255); border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;">
|
valign="middle"
|
||||||
<font face="微软雅黑" size="5" style="color: rgb(255, 255, 255); ">智能客服平台验证码</font>
|
style="
|
||||||
|
background: linear-gradient(
|
||||||
|
90deg,
|
||||||
|
#ebf1ff 24.34%,
|
||||||
|
#e5fbf8 56.18%,
|
||||||
|
#f2ebfe 90.18%
|
||||||
|
);
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px;
|
||||||
|
padding: 15px 35px;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-color: rgba(51, 112, 255);
|
||||||
|
border-top-left-radius: 5px;
|
||||||
|
border-top-right-radius: 5px;
|
||||||
|
border-bottom-right-radius: 0px;
|
||||||
|
border-bottom-left-radius: 0px;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
width: 230px;
|
||||||
|
background: linear-gradient(180deg, #3370ff 0%, #7f3bf5 100%);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
font-size: 24px;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
font-family: Arial Black;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 900;
|
||||||
|
color: #1f2329;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
MaxKB 智能知识库
|
||||||
|
</div>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="word-break:break-all">
|
<td style="word-break: break-all">
|
||||||
<div style="padding:25px 35px 40px; background-color:#fff;opacity:0.8;">
|
<div
|
||||||
|
style="
|
||||||
|
padding: 25px 35px 40px;
|
||||||
|
background-color: #fff;
|
||||||
|
opacity: 0.8;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<h2 style="margin: 5px 0px">
|
||||||
|
<font color="#333333" style="line-height: 20px">
|
||||||
|
<font style="line-height: 22px" size="4">
|
||||||
|
尊敬的用户:</font
|
||||||
|
>
|
||||||
|
</font>
|
||||||
|
</h2>
|
||||||
|
<!-- 中文 -->
|
||||||
|
<p>
|
||||||
|
<font color="#ff8c00" style="font-weight: 900">${code}</font
|
||||||
|
> 为您的动态验证码,请于30分钟内填写,为保障帐户安全,请勿向任何人提供此验证码。
|
||||||
|
</p>
|
||||||
|
<br />
|
||||||
|
|
||||||
<h2 style="margin: 5px 0px; ">
|
<div style="width: 100%; margin: 0 auto">
|
||||||
<font color="#333333" style="line-height: 20px; ">
|
<div
|
||||||
<font style="line-height: 22px; " size="4">
|
style="
|
||||||
尊敬的用户:</font>
|
padding: 10px 10px 0;
|
||||||
</font>
|
border-top: 1px solid #ccc;
|
||||||
</h2>
|
color: #747474;
|
||||||
<!-- 中文 -->
|
margin-bottom: 20px;
|
||||||
<p><font color="#ff8c00" style="font-weight: 900;">${code}</font> 为您的动态验证码,请于30分钟内填写,为保障帐户安全,请勿向任何人提供此验证码。
|
line-height: 1.3em;
|
||||||
</p><br>
|
font-size: 12px;
|
||||||
|
text-align: right;
|
||||||
<div style="width:100%;margin:0 auto;">
|
"
|
||||||
<div style="padding:10px 10px 0;border-top:1px solid #ccc;color:#747474;margin-bottom:20px;line-height:1.3em;font-size:12px;text-align:right">
|
>
|
||||||
<p>飞致云</p>
|
<p>飞致云 - MaxKB 项目组</p>
|
||||||
<br>
|
<br />
|
||||||
<p>此为系统邮件,请勿回复<br>
|
<p>
|
||||||
Please do not reply to this system email
|
此为系统邮件,请勿回复<br />
|
||||||
</p>
|
Please do not reply to this system email
|
||||||
<!--<p>©***</p>-->
|
</p>
|
||||||
</div>
|
<!--<p>©***</p>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -321,7 +321,7 @@ class SendEmailSerializer(ApiMixin, serializers.Serializer):
|
|||||||
user_cache.set(code_cache_key_lock, code, timeout=datetime.timedelta(minutes=1))
|
user_cache.set(code_cache_key_lock, code, timeout=datetime.timedelta(minutes=1))
|
||||||
try:
|
try:
|
||||||
# 发送邮件
|
# 发送邮件
|
||||||
send_mail(f'【智能客服{"用户注册" if state == "register" else "修改密码"}】',
|
send_mail(f'【MaxKB 智能知识库-{"用户注册" if state == "register" else "修改密码"}】',
|
||||||
'',
|
'',
|
||||||
html_message=f'{content.replace("${code}", code)}',
|
html_message=f'{content.replace("${code}", code)}',
|
||||||
from_email=EMAIL_ADDRESS,
|
from_email=EMAIL_ADDRESS,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user