mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-10 09:19:24 +01:00
Specify mailto: prefix for emails in Server Settings (#5844)
* Specify mailto: prefix for emails in Server Settings * resolve test failure * Update wording * Apply mailto-prefix on setting change --------- Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
This commit is contained in:
parent
966547db54
commit
fca3480e37
3 changed files with 16 additions and 6 deletions
|
@ -1049,11 +1049,22 @@ namespace BTCPayServer.Controllers
|
|||
vm.LogoFileId = theme.LogoFileId;
|
||||
vm.CustomThemeFileId = theme.CustomThemeFileId;
|
||||
|
||||
if (server.ServerName != vm.ServerName || server.ContactUrl != vm.ContactUrl)
|
||||
if (server.ServerName != vm.ServerName)
|
||||
{
|
||||
server.ServerName = vm.ServerName;
|
||||
server.ContactUrl = vm.ContactUrl;
|
||||
settingsChanged = true;
|
||||
}
|
||||
|
||||
if (server.ContactUrl != vm.ContactUrl)
|
||||
{
|
||||
server.ContactUrl = !string.IsNullOrWhiteSpace(vm.ContactUrl)
|
||||
? vm.ContactUrl.IsValidEmail() ? $"mailto:{vm.ContactUrl}" : vm.ContactUrl
|
||||
: null;
|
||||
settingsChanged = true;
|
||||
}
|
||||
|
||||
if (settingsChanged)
|
||||
{
|
||||
await _SettingsRepository.UpdateSetting(server);
|
||||
}
|
||||
|
||||
|
|
|
@ -548,7 +548,7 @@ namespace BTCPayServer.Controllers
|
|||
blob.CustomLogo = model.CustomLogo;
|
||||
blob.CustomCSS = model.CustomCSS;
|
||||
blob.HtmlTitle = string.IsNullOrWhiteSpace(model.HtmlTitle) ? null : model.HtmlTitle;
|
||||
blob.StoreSupportUrl = string.IsNullOrWhiteSpace(model.SupportUrl) ? null : model.SupportUrl;
|
||||
blob.StoreSupportUrl = string.IsNullOrWhiteSpace(model.SupportUrl) ? null : model.SupportUrl.IsValidEmail() ? $"mailto:{model.SupportUrl}" : model.SupportUrl;
|
||||
blob.DisplayExpirationTimer = TimeSpan.FromMinutes(model.DisplayExpirationTimer);
|
||||
blob.AutoDetectLanguage = model.AutoDetectLanguage;
|
||||
blob.DefaultLang = model.DefaultLang;
|
||||
|
|
|
@ -28,9 +28,8 @@
|
|||
<label asp-for="ContactUrl" class="form-label"></label>
|
||||
<input asp-for="ContactUrl" class="form-control" />
|
||||
<div class="form-text">
|
||||
Contact link for support requests related to this BTCPay Server instance.
|
||||
This link will appear on public facing pages.
|
||||
Can be any valid URI, such as a website, email, and Nostr.
|
||||
Add an email address or an external URL where users can contact you for support requests
|
||||
through a "Contact Us" button, displayed at the bottom of the public facing pages.
|
||||
</div>
|
||||
<span asp-validation-for="ContactUrl" class="text-danger"></span>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue