Refactor email account handling for dynamic resolution

Reintroduced `EmailAccountDto` with conditional compilation to support both .NET and non-.NET environments. Updated `IEmailService` to accept `EmailAccountDto` as the sender, replacing reliance on pre-configured SMTP credentials.

Added `GetSenderQuery` and its handler to dynamically resolve email accounts based on `Id` or `Username`. Introduced `GetSenderQueryValidator` for validation, ensuring proper usage of the query.

Modified `SendEmailCommand` to include sender resolution via MediatR. Updated `OutgoingEmailEvent` to include sender information and adjusted `OutgoingEmailConsumer` and `LimilabsEmailService` to use the dynamically resolved sender.

Updated `EmailMappingProfile` to ignore the `Sender` property during mapping. Replaced `Name` with `Id` in `appsettings.Secrets.json` for email accounts. Removed the old `EmailAccountDto` folder and performed general cleanup and restructuring.
This commit is contained in:
2026-08-05 12:32:08 +02:00
parent 7fa3c4888a
commit 740bb8c313
12 changed files with 136 additions and 45 deletions

View File

@@ -18,7 +18,7 @@
"EmailAccounts": {
"Accounts": [
{
"Name": "1",
"Id": "1",
"Username": "test-flow@digitaldata.works",
"Password": "ddemail108",
"PasswordEncrypted": false,