Add support for email attachments in messaging service

Introduced the `EmailAttachmentContext` class to represent email
attachments, with properties for file name, content, content type,
inline display behavior, and content ID. Used conditional compilation
to support both .NET Framework and .NET versions.

Updated the `EmailContext` class to include an `Attachments`
property, enabling emails to include attachments as byte arrays or
file paths.

Enhanced the `LimilabsEmailService` class to handle attachments:
- Added the `AddAttachments` method to process inline and regular
  attachments.
- Integrated attachment handling into the email-building process.
This commit is contained in:
2026-08-05 16:00:55 +02:00
parent fa9b4973b9
commit 890c32f1c8
3 changed files with 83 additions and 0 deletions

View File

@@ -45,4 +45,11 @@ public record EmailContext
#else
public bool IsHtml { get; init; } = true;
#endif
/// <summary>
/// Optional list of attachments to include with the email.
/// Each entry may carry its content as a byte array (<see cref="EmailAttachmentContext.Content"/>)
/// or reference a file on disk via <see cref="EmailAttachmentContext.FilePath"/>.
/// </summary>
public IEnumerable<EmailAttachmentContext> Attachments { get; set; } = [];
}