Skip to content

Commit fe78de5

Browse files
committed
feat: add email templates for verification codes in English, Chinese, and Traditional Chinese
1 parent 28a909e commit fe78de5

File tree

6 files changed

+395
-152
lines changed

6 files changed

+395
-152
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<!DOCTYPE html>
2+
<html xmlns:th="http://www.thymeleaf.org">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="description" content="email code" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
</head>
9+
<!--邮箱验证码模板-->
10+
<body>
11+
<div style="background-color: #ececec; padding: 35px">
12+
<table
13+
cellpadding="0"
14+
style="
15+
width: 800px;
16+
height: 100%;
17+
margin: 0px auto;
18+
text-align: left;
19+
position: relative;
20+
border-top-left-radius: 5px;
21+
border-top-right-radius: 5px;
22+
border-bottom-right-radius: 5px;
23+
border-bottom-left-radius: 5px;
24+
font-size: 14px;
25+
line-height: 1.5;
26+
box-shadow: rgb(153, 153, 153) 0px 0px 5px;
27+
border-collapse: collapse;
28+
background-position: initial initial;
29+
background-repeat: initial initial;
30+
background: #fff;
31+
"
32+
>
33+
<tbody>
34+
<tr>
35+
<th
36+
valign="middle"
37+
style="
38+
background: linear-gradient(
39+
90deg,
40+
#ebf1ff 24.34%,
41+
#e5fbf8 56.18%,
42+
#f2ebfe 90.18%
43+
);
44+
height: 25px;
45+
line-height: 25px;
46+
padding: 15px 35px;
47+
border-bottom-width: 1px;
48+
border-bottom-color: rgba(51, 112, 255);
49+
border-top-left-radius: 5px;
50+
border-top-right-radius: 5px;
51+
border-bottom-right-radius: 0px;
52+
border-bottom-left-radius: 0px;
53+
"
54+
>
55+
<div
56+
style="
57+
width: 500px;
58+
background: linear-gradient(180deg, #3370FF 0%, #7f3bf5 100%);
59+
-webkit-background-clip: text;
60+
font-size: 16px;
61+
-webkit-text-fill-color: transparent;
62+
font-style: normal;
63+
font-weight: 900;
64+
color: #1f2329;
65+
"
66+
>
67+
Intelligent Knowledge Q&A System
68+
</div>
69+
</th>
70+
</tr>
71+
<tr>
72+
<td style="word-break: break-all">
73+
<div
74+
style="
75+
padding: 25px 35px 40px;
76+
background-color: #fff;
77+
opacity: 0.8;
78+
"
79+
>
80+
<h2 style="margin: 5px 0px">
81+
<font color="#333333" style="line-height: 20px">
82+
<font style="line-height: 22px" size="4">
83+
84+
Dear user:</font
85+
>
86+
</font>
87+
</h2>
88+
<!-- 中文 -->
89+
<p>
90+
<font color="#ff8c00" style="font-weight: 900">${code}</font
91+
>&nbsp;&nbsp;This is your dynamic verification code. Please fill it in within 30 minutes. To protect the security of your account, please do not provide this verification code to anyone.
92+
</p>
93+
<br />
94+
95+
<div style="width: 100%; margin: 0 auto">
96+
<div
97+
style="
98+
padding: 10px 10px 0;
99+
border-top: 1px solid #ccc;
100+
color: #747474;
101+
margin-bottom: 20px;
102+
line-height: 1.3em;
103+
font-size: 12px;
104+
text-align: right;
105+
"
106+
>
107+
<p>Intelligent knowledge base project team</p>
108+
<br />
109+
<p>
110+
Please do not reply to this system email<br />
111+
</p>
112+
<!--<p>©***</p>-->
113+
</div>
114+
</div>
115+
</div>
116+
</td>
117+
</tr>
118+
</tbody>
119+
</table>
120+
</div>
121+
</body>
122+
</html>
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<!DOCTYPE html>
2+
<html xmlns:th="http://www.thymeleaf.org">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="description" content="email code" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
</head>
9+
<!--邮箱验证码模板-->
10+
<body>
11+
<div style="background-color: #ececec; padding: 35px">
12+
<table
13+
cellpadding="0"
14+
style="
15+
width: 800px;
16+
height: 100%;
17+
margin: 0px auto;
18+
text-align: left;
19+
position: relative;
20+
border-top-left-radius: 5px;
21+
border-top-right-radius: 5px;
22+
border-bottom-right-radius: 5px;
23+
border-bottom-left-radius: 5px;
24+
font-size: 14px;
25+
line-height: 1.5;
26+
box-shadow: rgb(153, 153, 153) 0px 0px 5px;
27+
border-collapse: collapse;
28+
background-position: initial initial;
29+
background-repeat: initial initial;
30+
background: #fff;
31+
"
32+
>
33+
<tbody>
34+
<tr>
35+
<th
36+
valign="middle"
37+
style="
38+
background: linear-gradient(
39+
90deg,
40+
#ebf1ff 24.34%,
41+
#e5fbf8 56.18%,
42+
#f2ebfe 90.18%
43+
);
44+
height: 25px;
45+
line-height: 25px;
46+
padding: 15px 35px;
47+
border-bottom-width: 1px;
48+
border-bottom-color: rgba(51, 112, 255);
49+
border-top-left-radius: 5px;
50+
border-top-right-radius: 5px;
51+
border-bottom-right-radius: 0px;
52+
border-bottom-left-radius: 0px;
53+
"
54+
>
55+
<div
56+
style="
57+
width: 230px;
58+
background: linear-gradient(180deg, #3370FF 0%, #7f3bf5 100%);
59+
-webkit-background-clip: text;
60+
font-size: 24px;
61+
-webkit-text-fill-color: transparent;
62+
font-style: normal;
63+
font-weight: 900;
64+
color: #1f2329;
65+
"
66+
>
67+
智能知识库问答系统
68+
</div>
69+
</th>
70+
</tr>
71+
<tr>
72+
<td style="word-break: break-all">
73+
<div
74+
style="
75+
padding: 25px 35px 40px;
76+
background-color: #fff;
77+
opacity: 0.8;
78+
"
79+
>
80+
<h2 style="margin: 5px 0px">
81+
<font color="#333333" style="line-height: 20px">
82+
<font style="line-height: 22px" size="4">
83+
尊敬的用户:</font
84+
>
85+
</font>
86+
</h2>
87+
<!-- 中文 -->
88+
<p>
89+
<font color="#ff8c00" style="font-weight: 900">${code}</font
90+
>&nbsp;&nbsp;为您的动态验证码,请于30分钟内填写,为保障帐户安全,请勿向任何人提供此验证码。
91+
</p>
92+
<br />
93+
94+
<div style="width: 100%; margin: 0 auto">
95+
<div
96+
style="
97+
padding: 10px 10px 0;
98+
border-top: 1px solid #ccc;
99+
color: #747474;
100+
margin-bottom: 20px;
101+
line-height: 1.3em;
102+
font-size: 12px;
103+
text-align: right;
104+
"
105+
>
106+
<p>智能知识库项目组</p>
107+
<br />
108+
<p>
109+
此为系统邮件,请勿回复<br />
110+
</p>
111+
<!--<p>©***</p>-->
112+
</div>
113+
</div>
114+
</div>
115+
</td>
116+
</tr>
117+
</tbody>
118+
</table>
119+
</div>
120+
</body>
121+
</html>
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<!DOCTYPE html>
2+
<html xmlns:th="http://www.thymeleaf.org">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="description" content="email code" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
</head>
9+
<!--邮箱验证码模板-->
10+
<body>
11+
<div style="background-color: #ececec; padding: 35px">
12+
<table
13+
cellpadding="0"
14+
style="
15+
width: 800px;
16+
height: 100%;
17+
margin: 0px auto;
18+
text-align: left;
19+
position: relative;
20+
border-top-left-radius: 5px;
21+
border-top-right-radius: 5px;
22+
border-bottom-right-radius: 5px;
23+
border-bottom-left-radius: 5px;
24+
font-size: 14px;
25+
line-height: 1.5;
26+
box-shadow: rgb(153, 153, 153) 0px 0px 5px;
27+
border-collapse: collapse;
28+
background-position: initial initial;
29+
background-repeat: initial initial;
30+
background: #fff;
31+
"
32+
>
33+
<tbody>
34+
<tr>
35+
<th
36+
valign="middle"
37+
style="
38+
background: linear-gradient(
39+
90deg,
40+
#ebf1ff 24.34%,
41+
#e5fbf8 56.18%,
42+
#f2ebfe 90.18%
43+
);
44+
height: 25px;
45+
line-height: 25px;
46+
padding: 15px 35px;
47+
border-bottom-width: 1px;
48+
border-bottom-color: rgba(51, 112, 255);
49+
border-top-left-radius: 5px;
50+
border-top-right-radius: 5px;
51+
border-bottom-right-radius: 0px;
52+
border-bottom-left-radius: 0px;
53+
"
54+
>
55+
<div
56+
style="
57+
width: 230px;
58+
background: linear-gradient(180deg, #3370FF 0%, #7f3bf5 100%);
59+
-webkit-background-clip: text;
60+
font-size: 24px;
61+
-webkit-text-fill-color: transparent;
62+
font-style: normal;
63+
font-weight: 900;
64+
color: #1f2329;
65+
"
66+
>
67+
68+
智慧知識庫問答系統
69+
</div>
70+
</th>
71+
</tr>
72+
<tr>
73+
<td style="word-break: break-all">
74+
<div
75+
style="
76+
padding: 25px 35px 40px;
77+
background-color: #fff;
78+
opacity: 0.8;
79+
"
80+
>
81+
<h2 style="margin: 5px 0px">
82+
<font color="#333333" style="line-height: 20px">
83+
<font style="line-height: 22px" size="4">
84+
85+
尊敬的用戶:</font
86+
>
87+
</font>
88+
</h2>
89+
<!-- 中文 -->
90+
<p>
91+
<font color="#ff8c00" style="font-weight: 900">${code}</font
92+
>&nbsp;&nbsp;為您的動態驗證碼,請於30分鐘內填寫,為保障帳戶安全,請勿向任何人提供此驗證碼。
93+
</p>
94+
<br />
95+
96+
<div style="width: 100%; margin: 0 auto">
97+
<div
98+
style="
99+
padding: 10px 10px 0;
100+
border-top: 1px solid #ccc;
101+
color: #747474;
102+
margin-bottom: 20px;
103+
line-height: 1.3em;
104+
font-size: 12px;
105+
text-align: right;
106+
"
107+
>
108+
<p>智慧知識庫專案組</p>
109+
<br />
110+
<p>
111+
此為系統郵件,請勿回覆<br />
112+
</p>
113+
<!--<p>©***</p>-->
114+
</div>
115+
</div>
116+
</div>
117+
</td>
118+
</tr>
119+
</tbody>
120+
</table>
121+
</div>
122+
</body>
123+
</html>

apps/models_provider/impl/volcanic_engine_model_provider/credential/tti.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ class VolcanicEngineTTIModelGeneralParams(BaseForm):
3030

3131

3232
class VolcanicEngineTTIModelCredential(BaseForm, BaseModelCredential):
33-
access_key = forms.PasswordInputField('Access Key ID', required=True)
34-
secret_key = forms.PasswordInputField('Secret Access Key', required=True)
33+
api_key = forms.PasswordInputField('Api key', required=True)
3534

3635
def is_valid(self, model_type: str, model_name, model_credential: Dict[str, object], model_params, provider,
3736
raise_exception=False):
@@ -40,7 +39,7 @@ def is_valid(self, model_type: str, model_name, model_credential: Dict[str, obje
4039
raise AppApiException(ValidCode.valid_error.value,
4140
gettext('{model_type} Model type is not supported').format(model_type=model_type))
4241

43-
for key in ['access_key', 'secret_key']:
42+
for key in ['api_key']:
4443
if key not in model_credential:
4544
if raise_exception:
4645
raise AppApiException(ValidCode.valid_error.value, gettext('{key} is required').format(key=key))
@@ -62,7 +61,7 @@ def is_valid(self, model_type: str, model_name, model_credential: Dict[str, obje
6261
return True
6362

6463
def encryption_dict(self, model: Dict[str, object]):
65-
return {**model, 'secret_key': super().encryption(model.get('secret_key', ''))}
64+
return {**model, 'api_key': super().encryption(model.get('api_key', ''))}
6665

6766
def get_model_params_setting_form(self, model_name):
6867
return VolcanicEngineTTIModelGeneralParams()

0 commit comments

Comments
 (0)