mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-12 10:30:47 +01:00
* Adding endpoint in Greenfield to allow server email settings * Adding related swagger file * Refactoring EmailSettingsData to be more readable * Adding server email masking * Adding tests * Update BTCPayServer/wwwroot/swagger/v1/swagger.template.serveremail.json Co-authored-by: d11n <mail@dennisreimann.de> * Masking smtp server email returned over greenfield api and test * Retaining password if password mask is used * Remove magic string ***** * Flatten request for server's settings. Fix bug on shared setting instances * Remove useless doc * Simplify code * Fix Store Email settings page --------- Co-authored-by: d11n <mail@dennisreimann.de> Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
30 lines
723 B
C#
30 lines
723 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 bool PasswordSet { get; set; }
|
|
|
|
[MailboxAddress]
|
|
[Display(Name = "Test Email")]
|
|
public string TestEmail { get; set; }
|
|
|
|
public EmailsViewModel()
|
|
{
|
|
}
|
|
|
|
public EmailsViewModel(EmailSettings settings)
|
|
{
|
|
Settings = settings;
|
|
PasswordSet = !string.IsNullOrWhiteSpace(settings?.Password);
|
|
}
|
|
|
|
public bool IsSetup() => Settings?.IsComplete() is true;
|
|
|
|
public bool IsFallbackSetup { get; set; }
|
|
public bool IsCustomSMTP { get; set; }
|
|
}
|