예제 #1
0
        Task EmailAsync(string[] recipients, string subjectTemplate, string bodyTemplate, string bodyHtmlTemplate, object model, IEnumerable <System.Net.Mail.Attachment> attachments = null)
        {
            var subject  = ProcessRazorTemplate(subjectTemplate, model);
            var body     = ProcessRazorTemplate(bodyTemplate, model);
            var bodyHtml = ProcessRazorTemplate(bodyHtmlTemplate, model);

            EmailServer.SendEmail(subject, body, bodyHtml, recipients, attachments);
            return(Task.CompletedTask);
        }
예제 #2
0
        Task IBackgroundTasks.Email(string recipient, string subjectTemplate, string bodyTemplate, string bodyHtmlTemplate, object model)
        {
            var subject  = ProcessRazorTemplate(subjectTemplate, model);
            var body     = ProcessRazorTemplate(bodyTemplate, model);
            var bodyHtml = ProcessRazorTemplate(bodyHtmlTemplate, model);

            EmailServer.SendEmail(subject, body, bodyHtml, recipient);
            return(Task.CompletedTask);
        }
        private void SendStatusEmail()
        {
            var changedProjects = _currentProjects.Where(x => x.HasNewHistory).ToList();
            var sb = new StringBuilder();

            foreach (var project in changedProjects)
            {
                sb.AppendLine(project.GetHistoryForEmail());
            }
            _smtpServer.SendEmail(sb.ToString());
        }
 public void SendEmail(string toAdress, string message)
 {
     _emailServer.SendEmail(toAdress, message);
 }