Added support for one click unsubscribe with confirmation dialog.

This commit is contained in:
Aleh Khantsevich
2024-05-01 14:23:23 +02:00
parent 2bcb6a146b
commit e2f0c73bab
5 changed files with 118 additions and 22 deletions

View File

@@ -11,10 +11,9 @@ namespace Wino.Core.Domain.Models.Reader
{
public string RenderHtml { get; }
public MailRenderingOptions MailRenderingOptions { get; }
public List<MimePart> Attachments { get; set; } = new List<MimePart>();
public List<MimePart> Attachments { get; set; } = [];
public string UnsubscribeLink { get; set; }
public bool CanUnsubscribe => !string.IsNullOrEmpty(UnsubscribeLink);
public UnsubscribeInfo UnsubscribeInfo { get; set; }
public MailRenderModel(string renderHtml, MailRenderingOptions mailRenderingOptions = null)
{
@@ -22,4 +21,12 @@ namespace Wino.Core.Domain.Models.Reader
MailRenderingOptions = mailRenderingOptions;
}
}
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;
}
}