Support multiple email recipients in email-sending flow

Updated the `IEmailService` interface and related components to
support multiple recipients in the `SendEmailAsync` method.

- Replaced `Recipient` with `Recipients` in `SendEmailCommand`,
  `OutgoingEmailEvent`, and `EmailsController`.
- Updated `SendEmailCommandValidator` to validate a collection
  of recipients, ensuring at least one valid email address.
- Modified `LimilabsEmailService` to handle multiple recipients
  by iterating over the collection and adding each to the email.
- Adjusted `OutgoingEmailConsumer` to process and log multiple
  recipients.
- Updated logging and response structures to reflect the changes.

These changes enable the system to handle emails with multiple
recipients while maintaining proper validation and logging.
This commit is contained in:
2026-08-05 13:02:57 +02:00
parent 740bb8c313
commit e47333cd1d
7 changed files with 21 additions and 18 deletions

View File

@@ -27,10 +27,7 @@ public class EmailsController(IMediator mediator) : ControllerBase
return Accepted(new
{
CommandId = outgoingEmailEvent.Id,
To = outgoingEmailEvent.Recipient,
outgoingEmailEvent.Subject,
outgoingEmailEvent.QueuedAt
outgoingEmailEvent.Id,
});
}
}