113 lines
2.6 KiB
C#
113 lines
2.6 KiB
C#
namespace DigitalData.MessagingService.Application.Common.Dto;
|
|
|
|
/// <summary>
|
|
/// Represents an email message received via IMAP.
|
|
/// </summary>
|
|
public sealed record ReceivedEmailDto
|
|
{
|
|
/// <summary>
|
|
/// Unique identifier of the message on the IMAP server (UID).
|
|
/// </summary>
|
|
#if NET
|
|
public long Uid { get; init; }
|
|
#else
|
|
public long Uid { get; set; }
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// ID of the email account this message belongs to.
|
|
/// </summary>
|
|
#if NET
|
|
public int AccountId { get; init; }
|
|
#else
|
|
public int AccountId { get; set; }
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Sender address (From header).
|
|
/// </summary>
|
|
#if NET
|
|
public string From { get; init; } = string.Empty;
|
|
#else
|
|
public string From { get; set; } = string.Empty;
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Recipient addresses (To header).
|
|
/// </summary>
|
|
#if NET
|
|
public IEnumerable<string> To { get; init; } = [];
|
|
#else
|
|
public IEnumerable<string> To { get; set; } = [];
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// CC addresses.
|
|
/// </summary>
|
|
#if NET
|
|
public IEnumerable<string> Cc { get; init; } = [];
|
|
#else
|
|
public IEnumerable<string> Cc { get; set; } = [];
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Email subject.
|
|
/// </summary>
|
|
#if NET
|
|
public string Subject { get; init; } = string.Empty;
|
|
#else
|
|
public string Subject { get; set; } = string.Empty;
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Plain-text body (may be empty when only HTML is present).
|
|
/// </summary>
|
|
#if NET
|
|
public string TextBody { get; init; } = string.Empty;
|
|
#else
|
|
public string TextBody { get; set; } = string.Empty;
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// HTML body (may be empty when only plain-text is present).
|
|
/// </summary>
|
|
#if NET
|
|
public string HtmlBody { get; init; } = string.Empty;
|
|
#else
|
|
public string HtmlBody { get; set; } = string.Empty;
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Date/time the message was sent (Date header).
|
|
/// </summary>
|
|
#if NET
|
|
public DateTime Date { get; init; }
|
|
#else
|
|
public DateTime Date { get; set; }
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Attachments included with this message.
|
|
/// </summary>
|
|
#if NET
|
|
public IEnumerable<EmailAttachmentDto> Attachments { get; init; } = [];
|
|
#else
|
|
public IEnumerable<EmailAttachmentDto> Attachments { get; set; } = [];
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Whether the message has been marked as seen/read on the server.
|
|
/// </summary>
|
|
#if NET
|
|
public bool IsSeen { get; init; }
|
|
#else
|
|
public bool IsSeen { get; set; }
|
|
#endif
|
|
|
|
#if NET
|
|
public required string Folder { get; init; }
|
|
#else
|
|
public string Folder { get; set; } = null!;
|
|
#endif
|
|
}
|