Refactor email handling for multiple recipients
Refactored the `Email` and `OutgoingEmailEvent` classes to replace the `Recipient` property with a `Recipients` collection, enabling support for multiple recipients. Updated all related test cases, including `EmailSenderTests`, `EmailSenderUrlOverloadTests`, and `OutgoingEmailPublisherTests`, to reflect this change. Moved the `EmailAccountDto` class and its references from the `DigitalData.MessagingService.Application.Common.Dtos` namespace to the `DigitalData.MessagingService.Publisher.Abstraction` namespace for better code organization. Updated `using` directives across affected files. Removed unused `using` directives and updated the `Email` class's `ToEvent` method to map the new `Recipients` property. Adjusted test assertions to validate collections instead of single recipient strings.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using DigitalData.MessagingService.API.Middleware;
|
||||
using DigitalData.MessagingService.Application;
|
||||
using DigitalData.MessagingService.Application.Common.Dtos;
|
||||
using DigitalData.MessagingService.Infrastructure;
|
||||
using Serilog;
|
||||
using Serilog.Ui.Core.Extensions;
|
||||
|
||||
@@ -10,7 +10,7 @@ public record Email
|
||||
/// <summary>
|
||||
/// Recipient email address
|
||||
/// </summary>
|
||||
public string Recipient { get; set; } = null!;
|
||||
public IEnumerable<string> Recipients { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Email subject
|
||||
@@ -36,7 +36,7 @@ public record Email
|
||||
return new OutgoingEmailEvent
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Recipient = Recipient,
|
||||
Recipients = Recipients,
|
||||
Subject = Subject,
|
||||
Body = Body,
|
||||
IsHtml = IsHtml,
|
||||
|
||||
Reference in New Issue
Block a user