using System; using System.Collections.Generic; using System.Linq; namespace Disco.Models.Services.Messaging { public class Email { public string From { get; set; } public string ReplyTo { get; set; } public List To { get; } = new List(); public List CC { get; } = new List(); public List BCC { get; } = new List(); public string Subject { get; set; } public bool IsBodyHtml { get; set; } public string Body { get; set; } public List Attachments { get; } = new List(); public Email() { } public Email(string to, string subject, string body) : this() { To.Add(to); Subject = subject; Body = body; } public static IEnumerable ParseEmailAddresses(string emailAddresses) { return emailAddresses.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()); } } }