mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 21:32:27 +01:00
22 lines
607 B
C#
22 lines
607 B
C#
using System;
|
|
using System.Linq;
|
|
using BTCPayServer.Data;
|
|
using BTCPayServer.Services.Invoices;
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|