mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-16 07:53:49 +08:00
feat: add "Sender number" input for Twilio SMS provider
This commit is contained in:
@ -42,7 +42,11 @@ func SendSms(provider *Provider, content string, phoneNumbers ...string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if provider.Type == sender.Aliyun {
|
if provider.Type == sender.Twilio {
|
||||||
|
if provider.AppId != "" {
|
||||||
|
phoneNumbers = append([]string{provider.AppId}, phoneNumbers...)
|
||||||
|
}
|
||||||
|
} else if provider.Type == sender.Aliyun {
|
||||||
for i, number := range phoneNumbers {
|
for i, number := range phoneNumbers {
|
||||||
phoneNumbers[i] = strings.TrimPrefix(number, "+86")
|
phoneNumbers[i] = strings.TrimPrefix(number, "+86")
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,10 @@ class ProviderEditPage extends React.Component {
|
|||||||
tooltip = i18next.t("provider:Agent ID - Tooltip");
|
tooltip = i18next.t("provider:Agent ID - Tooltip");
|
||||||
}
|
}
|
||||||
} else if (provider.category === "SMS") {
|
} else if (provider.category === "SMS") {
|
||||||
if (provider.type === "Tencent Cloud SMS") {
|
if (provider.type === "Twilio SMS") {
|
||||||
|
text = i18next.t("provider:Sender number");
|
||||||
|
tooltip = i18next.t("provider:Sender number - Tooltip");
|
||||||
|
} else if (provider.type === "Tencent Cloud SMS") {
|
||||||
text = i18next.t("provider:App ID");
|
text = i18next.t("provider:App ID");
|
||||||
tooltip = i18next.t("provider:App ID - Tooltip");
|
tooltip = i18next.t("provider:App ID - Tooltip");
|
||||||
} else if (provider.type === "Volc Engine SMS") {
|
} else if (provider.type === "Volc Engine SMS") {
|
||||||
@ -674,6 +677,7 @@ class ProviderEditPage extends React.Component {
|
|||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
{this.getAppIdRow(this.state.provider)}
|
||||||
{
|
{
|
||||||
this.state.provider.category === "Email" ? (
|
this.state.provider.category === "Email" ? (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
@ -919,7 +923,6 @@ class ProviderEditPage extends React.Component {
|
|||||||
</Row>
|
</Row>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
{this.getAppIdRow(this.state.provider)}
|
|
||||||
<Row style={{marginTop: "20px"}} >
|
<Row style={{marginTop: "20px"}} >
|
||||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
{Setting.getLabel(i18next.t("provider:Provider URL"), i18next.t("provider:Provider URL - Tooltip"))} :
|
{Setting.getLabel(i18next.t("provider:Provider URL"), i18next.t("provider:Provider URL - Tooltip"))} :
|
||||||
|
Reference in New Issue
Block a user