U1 mail-foundation (backend): verzender, opties, sjabloon, SiteSettings met toegestane afzenderlijst
IEmailSender met MailKit-implementatie (StartTls, timeout, fouten als waarde), opties met startvalidatie, nl/en sjabloon, taalkeuze, tabel SiteSettings (additieve migratie), SiteSettings-API (Beheerder leest, Eigenaar wijzigt) en emailEnabled/defaultLanguage in de capabilities. Zonder SMTP-host verandert er niets. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using SlpModularCms.Core.Email;
|
||||
|
||||
namespace SlpModularCms.Core.Hosting;
|
||||
|
||||
@@ -12,15 +14,26 @@ namespace SlpModularCms.Core.Hosting;
|
||||
public class SystemController : ControllerBase
|
||||
{
|
||||
private readonly ModuleOrchestrator _orchestrator;
|
||||
private readonly IOptions<EmailOptions> _email;
|
||||
private readonly IOptions<AppMailOptions> _app;
|
||||
|
||||
public SystemController(ModuleOrchestrator orchestrator)
|
||||
public SystemController(ModuleOrchestrator orchestrator, IOptions<EmailOptions> email, IOptions<AppMailOptions> app)
|
||||
{
|
||||
_orchestrator = orchestrator;
|
||||
_email = email;
|
||||
_app = app;
|
||||
}
|
||||
|
||||
[HttpGet("capabilities")]
|
||||
public IActionResult GetCapabilities()
|
||||
{
|
||||
return Ok(new { Modules = _orchestrator.ModuleNames });
|
||||
// EmailEnabled tells the UI whether mail actions exist on this site; DefaultLanguage is the
|
||||
// site's mail language fallback. Neither exposes configuration values beyond that.
|
||||
return Ok(new
|
||||
{
|
||||
Modules = _orchestrator.ModuleNames,
|
||||
EmailEnabled = !string.IsNullOrWhiteSpace(_email.Value.Smtp.Host),
|
||||
DefaultLanguage = MailLanguages.Normalize(_app.Value.DefaultLanguage) ?? MailLanguages.Dutch
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user