From f38a1e3273b5444425b4857f6db8f800d8cb50a6 Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Thu, 4 Jun 2026 11:08:45 -0400 Subject: [PATCH] Add Reply-To diagnostic logging to GetEmailFromAsync Logs a Warning when no Reply-To email is configured for a company (so the logs show why replies land at the platform sender address) and a Debug entry when one is set, making future send issues diagnosable without needing the SendGrid Activity API. Co-Authored-By: Claude Sonnet 4.6 --- .../Services/NotificationService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/PowderCoating.Infrastructure/Services/NotificationService.cs b/src/PowderCoating.Infrastructure/Services/NotificationService.cs index 5bf903c..3c09bc7 100644 --- a/src/PowderCoating.Infrastructure/Services/NotificationService.cs +++ b/src/PowderCoating.Infrastructure/Services/NotificationService.cs @@ -1535,7 +1535,15 @@ public class NotificationService : INotificationService .AsNoTracking() .FirstOrDefaultAsync(p => p.CompanyId == companyId && !p.IsDeleted); - return (prefs?.EmailFromAddress, prefs?.EmailFromName); + var email = prefs?.EmailFromAddress; + var name = prefs?.EmailFromName; + + if (string.IsNullOrWhiteSpace(email)) + _logger.LogWarning("No Reply-To email configured for company {CompanyId} — outgoing emails will show platform sender as reply address", companyId); + else + _logger.LogDebug("Reply-To for company {CompanyId}: {ReplyToEmail}", companyId, email); + + return (email, name); } ///