fix: serialize smtp settings using runtime type not base class
JsonSerializer.Serialize(p.Settings) uses the compile-time type
EmailChannelSettings, producing only {EmailChannelType:1} in the DB.
Use p.Settings.GetType() to force runtime type so all SmtpChannelSettings
properties (Host, Port, Username, Password, etc.) are actually persisted.
Ref: IT-628
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -89,7 +89,7 @@ internal sealed class EmailChannelRepository : EfRepository<EmailChannelEntity>,
|
||||
ServiceName = p.ServiceName,
|
||||
Priority = p.Priority,
|
||||
EmailChannelType = p.EmailChannelType,
|
||||
SettingsJson = JsonSerializer.Serialize(p.Settings),
|
||||
SettingsJson = JsonSerializer.Serialize(p.Settings, p.Settings.GetType()),
|
||||
DailyLimit = p.DailyLimit,
|
||||
MonthlyLimit = p.MonthlyLimit,
|
||||
WarnThresholdPercent = p.WarnThresholdPercent,
|
||||
|
||||
Reference in New Issue
Block a user