Refactor: Move email services to the email plugin directory

This commit is contained in:
Nicolas Dorier
2025-11-12 11:12:47 +09:00
parent 666896df5c
commit b6c635c29b
43 changed files with 312 additions and 390 deletions

View File

@@ -1,17 +1,14 @@
#nullable enable
using System;
using System.Threading.Tasks;
using BTCPayServer.Abstractions.Constants;
using BTCPayServer.Abstractions.Extensions;
using BTCPayServer.Client;
using BTCPayServer.Client.Models;
using BTCPayServer.Models.ServerViewModels;
using BTCPayServer.Services;
using BTCPayServer.Services.Mails;
using BTCPayServer.Plugins.Emails.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Controllers.GreenField
{
@@ -30,7 +27,7 @@ namespace BTCPayServer.Controllers.GreenField
_policiesSettings = policiesSettings;
_settingsRepository = settingsRepository;
}
private ServerEmailSettingsData ToApiModel(EmailSettings email)
{
var data = email.ToData<ServerEmailSettingsData>();
@@ -52,7 +49,7 @@ namespace BTCPayServer.Controllers.GreenField
{
if (!string.IsNullOrWhiteSpace(request.From) && !MailboxAddressValidator.IsMailboxAddress(request.From))
ModelState.AddModelError(nameof(request.From), "Invalid email address");
if (!ModelState.IsValid)
return this.CreateValidationError(ModelState);