mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Improve email settings validation and UX (#3891)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using BTCPayServer.Data;
|
||||
using BTCPayServer.Services.Invoices;
|
||||
@@ -7,6 +8,15 @@ namespace BTCPayServer
|
||||
{
|
||||
public static class UserExtensions
|
||||
{
|
||||
public static MimeKit.MailboxAddress GetMailboxAddress(this ApplicationUser user)
|
||||
{
|
||||
if (user is null)
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
var name = user.UserName ?? String.Empty;
|
||||
if (user.Email == user.UserName)
|
||||
name = String.Empty;
|
||||
return new MimeKit.MailboxAddress(name, user.Email);
|
||||
}
|
||||
public static UserBlob GetBlob(this ApplicationUser user)
|
||||
{
|
||||
var result = user.Blob == null
|
||||
|
||||
Reference in New Issue
Block a user