fix(api): avoid NRE in MailSender on rdv query notifications
The API did not bind the Smtp section and its appsettings lacked Site.Owner, so MailSender threw a NullReferenceException and PostQuery returned 500. Bind Smtp in the API, add Owner/Smtp to the api appsettings template, and log/skip sending when mail configuration is incomplete. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
10d992a07a
commit
0e9f61bd24
5 changed files with 52 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ using Yavsc.Models;
|
|||
using Yavsc;
|
||||
using Yavsc.Server.Helpers;
|
||||
using Yavsc.Services;
|
||||
using Yavsc.Settings;
|
||||
using Yavsc.Server.Hubs;
|
||||
using Yavsc.Api.Services;
|
||||
|
||||
|
|
@ -71,6 +72,7 @@ internal class Program
|
|||
// Binds the "Site" section (Bills, TempDir, Avatars, …) used by
|
||||
// the document-generation flow and BillingController.
|
||||
services.Configure<SiteSettings>(builder.Configuration.GetSection("Site"));
|
||||
services.Configure<SmtpSettings>(builder.Configuration.GetSection("Smtp"));
|
||||
services.AddPodcasts(builder.Configuration);
|
||||
services.AddInvoicing(builder.Configuration);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue