Can set email title and content now.

This commit is contained in:
Yang Luo
2021-05-24 20:21:41 +08:00
parent 705c0159d4
commit 2fff5f79ce
6 changed files with 43 additions and 19 deletions

View File

@ -20,6 +20,7 @@ import * as Setting from "./Setting";
import i18next from "i18next";
const { Option } = Select;
const { TextArea } = Input;
class ProviderEditPage extends React.Component {
constructor(props) {
@ -126,6 +127,8 @@ class ProviderEditPage extends React.Component {
this.updateProviderField('type', 'GitHub');
} else if (value === "Email") {
this.updateProviderField('type', 'Default');
this.updateProviderField('title', 'Casdoor Verification Code');
this.updateProviderField('content', 'You have requested a verification code at Casdoor. Here is your code: %s, please enter in 5 minutes.');
} else if (value === "SMS") {
this.updateProviderField('type', 'aliyun');
}
@ -195,6 +198,26 @@ class ProviderEditPage extends React.Component {
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("provider:Email Title")}:
</Col>
<Col span={22} >
<Input value={this.state.provider.title} onChange={e => {
this.updateProviderField('title', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("provider:Email Content")}:
</Col>
<Col span={22} >
<TextArea autoSize={{minRows: 1, maxRows: 100}} value={this.state.provider.content} onChange={e => {
this.updateProviderField('content', e.target.value);
}} />
</Col>
</Row>
</React.Fragment>
) : this.state.provider.category === "SMS" ? (
<React.Fragment>

View File

@ -97,6 +97,8 @@
"Client secret": "Client secret",
"Host": "Host",
"Port": "Port",
"Email Title": "Email Title",
"Email Content": "Email Content",
"Region ID": "Region ID",
"Sign Name": "Sign Name",
"Template Code": "Template Code",

View File

@ -97,6 +97,8 @@
"Client secret": "Client secret",
"Host": "主机",
"Port": "端口号",
"Email Title": "邮件标题",
"Email Content": "邮件内容",
"Region ID": "地域ID",
"Sign Name": "签名名称",
"Template Code": "模板CODE",