2024-02-21 14:43:44 +01:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
using BTCPayServer.Services.Mails;
|
|
|
|
using BTCPayServer.Validation;
|
|
|
|
|
|
|
|
namespace BTCPayServer.Models;
|
|
|
|
|
|
|
|
public class EmailsViewModel
|
|
|
|
{
|
|
|
|
public EmailSettings Settings { get; set; }
|
|
|
|
public bool PasswordSet { get; set; }
|
2025-02-27 01:59:17 -05:00
|
|
|
|
2024-02-21 14:43:44 +01:00
|
|
|
[MailboxAddress]
|
|
|
|
[Display(Name = "Test Email")]
|
|
|
|
public string TestEmail { get; set; }
|
|
|
|
|
|
|
|
public EmailsViewModel()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2025-02-27 01:59:17 -05:00
|
|
|
public EmailsViewModel(EmailSettings settings)
|
2024-02-21 14:43:44 +01:00
|
|
|
{
|
|
|
|
Settings = settings;
|
2025-02-27 01:59:17 -05:00
|
|
|
PasswordSet = !string.IsNullOrWhiteSpace(settings?.Password);
|
2024-02-21 14:43:44 +01:00
|
|
|
}
|
2025-02-27 01:59:17 -05:00
|
|
|
|
2024-02-21 14:43:44 +01:00
|
|
|
public bool IsSetup() => Settings?.IsComplete() is true;
|
2025-02-27 01:59:17 -05:00
|
|
|
|
|
|
|
public bool IsFallbackSetup { get; set; }
|
|
|
|
public bool IsCustomSMTP { get; set; }
|
2024-02-21 14:43:44 +01:00
|
|
|
}
|