Exemplo n.º 1
0
        public async Task SendEmails(string subject, MarkdownString body, RecepientData sender, IReadOnlyCollection <RecepientData> to)
        {
            if (!to.Any())
            {
                return;
            }

            var html = body.ToHtmlString().ToHtmlString();
            var text = body.ToPlainText().ToString();

            for (var i = 0; i *Constants.MaxRecipientsInChunk < to.Count; i++)
            {
                await SendEmailChunkImpl(
                    to.Skip(i *Constants.MaxRecipientsInChunk).Take(Constants.MaxRecipientsInChunk).ToList(),
                    subject, text, sender, html);
            }
        }
Exemplo n.º 2
0
 public static string ToPlainText([CanBeNull] this MarkdownString markdownString)
 {
     return(markdownString.ToPlainText(NoLinks));
 }