diff --git a/PostFundManagement.Application/Events/LateProjectReminderEvent.cs b/PostFundManagement.Application/Events/LateProjectReminderEvent.cs index 69d1016..c2d38f6 100644 --- a/PostFundManagement.Application/Events/LateProjectReminderEvent.cs +++ b/PostFundManagement.Application/Events/LateProjectReminderEvent.cs @@ -34,8 +34,6 @@ public sealed class LateProjectEventHandler(IDbContextFactory 0 ? now.AddDays(-lateDays) : now; - // Query overdue milestones that are not yet approved - // Execute ToListAsync before GroupBy so EF Core does not fail SQL translation var overdueMilestones = await context.Milestones .AsNoTracking() .Include(i => i.Project) diff --git a/PostFundManagement.Application/Events/NonCompliantProjectEvent.cs b/PostFundManagement.Application/Events/NonCompliantProjectEvent.cs index 61e7b00..0869339 100644 --- a/PostFundManagement.Application/Events/NonCompliantProjectEvent.cs +++ b/PostFundManagement.Application/Events/NonCompliantProjectEvent.cs @@ -1,5 +1,3 @@ -using System.Net; -using System.Text; using PostFundManagement.Application.Abstractions.Services; using PostFundManagement.Application.Services.Communications; using PostFundManagement.Domain; @@ -33,7 +31,6 @@ public sealed class NonCompliantProjectEventHandler(IDbContextFactory p.Programme) @@ -167,14 +164,8 @@ public sealed class NonCompliantProjectEventHandler(IDbContextFactory contextFactory, - IServiceProvider provider, IFeatureManager featureManager) : INotificationHandler + IServiceProvider provider, IFeatureManager featureManager, IOptions options) : INotificationHandler { const int maxBatch = 100; + readonly SmtpSettings emailSettings = options.Value; public async ValueTask Handle(ProcessEmailEvent notification, CancellationToken cancellationToken) { @@ -74,8 +76,8 @@ public sealed class ProcessEmailEventHandler(IDbContextFactory