mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-12 19:02:01 +01:00
14 lines
496 B
C#
14 lines
496 B
C#
#nullable enable
|
|
using BTCPayServer.Client.Models;
|
|
|
|
namespace BTCPayServer
|
|
{
|
|
public static class ValidationExtensions
|
|
{
|
|
public static void Validate(this EmailSettingsData request, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelState)
|
|
{
|
|
if (!string.IsNullOrEmpty(request.From) && !MailboxAddressValidator.IsMailboxAddress(request.From))
|
|
modelState.AddModelError(nameof(request.From), "Invalid email address");
|
|
}
|
|
}
|
|
}
|