internal static async Task SendAsync(string toMailAddress, string subject, string body, string path) { EmailDto dto = new EmailDto(); dto.To.Add(toMailAddress); dto.Subject = subject; dto.Body = body; dto.AttachmentS3Url = path; await EmailService.SendAsync(dto).ConfigureAwait(false); }
internal static async Task SendAsync(EmailDto email, StringBuilder sb) { if (sb != null) { using (StreamWriter sw = new StreamWriter(new MemoryStream())) { sw.Write(sb.ToString()); sw.Flush(); email.AttachmentData = sw.BaseStream.ToByteArray(); } } await EmailService.SendAsync(email).ConfigureAwait(false); }