Introduced `EnvelopeNotificationBase` as a new base class for notifications, providing a unified structure with an abstract `GetTemplateType` method and optional attachments. Added `DocumentReceivedNotification` and updated `DocumentSignedNotification` to inherit from this base class, streamlining attachment handling and template type determination. Refactored `IEnvelopeNotificationService` to use a generic `Notify` method, allowing for flexibility with different notification types. Updated `FinalizeEnvelopeCommandHandler` to align with the new attachment handling. Added `EnvelopeNotificationExtensions` for converting attachments to `EmailAttachmentDto` objects and introduced `ReplacePlaceholderExtensions` for dynamic placeholder replacement in email templates using reflection. Removed outdated placeholder logic from `EnvelopeNotificationService`.
20 lines
443 B
C#
20 lines
443 B
C#
using EnvelopeGenerator.Domain.Constants;
|
|
|
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public abstract record EnvelopeNotificationBase
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public abstract EmailTemplateType GetTemplateType();
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public List<(string FileName, byte[] Content)>? Attachments { get; init; }
|
|
}
|