mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
9c95b98f3a
* Policies: Turn checkboxes into toggles * Move email policy to server email settings * Move maintenance policies to server maintenance settings * Policies: Adjust spacings * Policies: Remove DisableInstantNotifications setting * Wording updates * Move maintenance settings back
32 lines
946 B
C#
32 lines
946 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using BTCPayServer.Services.Mails;
|
|
using BTCPayServer.Validation;
|
|
|
|
namespace BTCPayServer.Models;
|
|
|
|
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, EmailSettings fallbackSettings = null)
|
|
{
|
|
Settings = settings;
|
|
FallbackSettings = fallbackSettings;
|
|
PasswordSet = !string.IsNullOrEmpty(settings?.Password);
|
|
}
|
|
|
|
public bool IsSetup() => Settings?.IsComplete() is true;
|
|
public bool IsFallbackSetup() => FallbackSettings?.IsComplete() is true;
|
|
public bool UsesFallback() => IsFallbackSetup() && Settings == FallbackSettings;
|
|
}
|