2021-06-04 10:41:17 +02:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Cms.Core.Models.Email
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents an email when sent with notifications.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class NotificationEmailModel
|
|
|
|
|
{
|
|
|
|
|
public NotificationEmailAddress From { get; }
|
|
|
|
|
|
|
|
|
|
public IEnumerable<NotificationEmailAddress> To { get; }
|
|
|
|
|
|
|
|
|
|
public IEnumerable<NotificationEmailAddress> Cc { get; }
|
|
|
|
|
|
|
|
|
|
public IEnumerable<NotificationEmailAddress> Bcc { get; }
|
|
|
|
|
|
|
|
|
|
public IEnumerable<NotificationEmailAddress> ReplyTo { get; }
|
|
|
|
|
|
|
|
|
|
public string Subject { get; }
|
|
|
|
|
|
|
|
|
|
public string Body { get; }
|
|
|
|
|
|
2021-06-04 11:06:59 +02:00
|
|
|
public bool IsBodyHtml { get; }
|
|
|
|
|
|
2022-01-21 11:43:58 +01:00
|
|
|
public IList<EmailMessageAttachment>? Attachments { get; }
|
2021-06-04 10:41:17 +02:00
|
|
|
|
|
|
|
|
public bool HasAttachments => Attachments != null && Attachments.Count > 0;
|
|
|
|
|
|
|
|
|
|
public NotificationEmailModel(
|
2022-02-18 14:32:51 +01:00
|
|
|
NotificationEmailAddress? from,
|
|
|
|
|
IEnumerable<NotificationEmailAddress?>? to,
|
|
|
|
|
IEnumerable<NotificationEmailAddress>? cc,
|
|
|
|
|
IEnumerable<NotificationEmailAddress>? bcc,
|
|
|
|
|
IEnumerable<NotificationEmailAddress>? replyTo,
|
|
|
|
|
string? subject,
|
|
|
|
|
string? body,
|
|
|
|
|
IEnumerable<EmailMessageAttachment>? attachments,
|
2021-06-04 11:06:59 +02:00
|
|
|
bool isBodyHtml)
|
2021-06-04 10:41:17 +02:00
|
|
|
{
|
|
|
|
|
From = from;
|
|
|
|
|
To = to;
|
|
|
|
|
Cc = cc;
|
|
|
|
|
Bcc = bcc;
|
|
|
|
|
ReplyTo = replyTo;
|
|
|
|
|
Subject = subject;
|
|
|
|
|
Body = body;
|
2021-06-04 11:06:59 +02:00
|
|
|
IsBodyHtml = isBodyHtml;
|
2022-02-11 14:27:04 +01:00
|
|
|
Attachments = attachments?.ToList();
|
2021-06-04 10:41:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|