Files
Wino-Mail/Wino.Core.Domain/Models/Reader/MailRenderModel.cs
T

38 lines
1.1 KiB
C#
Raw Normal View History

2024-04-18 01:44:37 +02:00
using System.Collections.Generic;
using MimeKit;
2025-11-23 20:56:57 +01:00
using MimeKit.Cryptography;
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
namespace Wino.Core.Domain.Models.Reader;
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
/// <summary>
/// Final model to be passed to renderer page.
/// Data here are created based on rendering settings.
/// </summary>
public class MailRenderModel
{
public string RenderHtml { get; }
public MailRenderingOptions MailRenderingOptions { get; }
public List<MimePart> Attachments { get; set; } = [];
2025-02-16 11:54:23 +01:00
public UnsubscribeInfo UnsubscribeInfo { get; set; }
2025-02-16 11:35:43 +01:00
2025-11-23 20:56:57 +01:00
public Dictionary<IDigitalSignature, bool> Signatures = [];
// Indicates if the mail is S/MIME encrypted
public bool IsSmimeEncrypted { get; set; }
2025-02-16 11:54:23 +01:00
public MailRenderModel(string renderHtml, MailRenderingOptions mailRenderingOptions = null)
2025-02-16 11:43:30 +01:00
{
2025-02-16 11:54:23 +01:00
RenderHtml = renderHtml;
MailRenderingOptions = mailRenderingOptions;
2025-02-16 11:43:30 +01:00
}
2025-02-16 11:35:43 +01:00
}
2025-02-16 11:54:23 +01:00
public class UnsubscribeInfo
{
public string HttpLink { get; set; }
public string MailToLink { get; set; }
public bool IsOneClick { get; set; }
public bool CanUnsubscribe => HttpLink != null || MailToLink != null;
}