mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Store Email Settings: Improve configuration (#5629)
* Store Email Settings: Improve configuration This works with the existing settings and provides better guidance about the different store email cases. Closes #5623. * Split email and notification settings
This commit is contained in:
@@ -6,25 +6,27 @@ namespace BTCPayServer.Models.ServerViewModels
|
||||
{
|
||||
public class EmailsViewModel
|
||||
{
|
||||
public EmailSettings Settings { get; set; }
|
||||
public EmailSettings FallbackSettings { get; set; }
|
||||
public bool PasswordSet { get; set; }
|
||||
|
||||
[MailboxAddress]
|
||||
[Display(Name = "Test Email")]
|
||||
public string TestEmail { get; set; }
|
||||
|
||||
public EmailsViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
public EmailsViewModel(EmailSettings settings)
|
||||
|
||||
public EmailsViewModel(EmailSettings settings, EmailSettings fallbackSettings = null)
|
||||
{
|
||||
Settings = settings;
|
||||
FallbackSettings = fallbackSettings;
|
||||
PasswordSet = !string.IsNullOrEmpty(settings?.Password);
|
||||
}
|
||||
public EmailSettings Settings
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public bool PasswordSet { get; set; }
|
||||
[MailboxAddressAttribute]
|
||||
[Display(Name = "Test Email")]
|
||||
public string TestEmail
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public bool IsSetup() => Settings?.IsComplete() is true;
|
||||
public bool IsFallbackSetup() => FallbackSettings?.IsComplete() is true;
|
||||
public bool UsesFallback() => IsFallbackSetup() && Settings == FallbackSettings;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user