public async Task <IActionResult> SendLead(EmailLeadModel model) { var lead = await _leadManager.GetDetailAsync(model.Id); if (lead.Email == null) { BadRequest("Customer doesn't have email address"); } var dirPath = Utility.GetEmailFolder(_hostingEnvironment.WebRootPath); var completePath = dirPath + model.FileName; if (!System.IO.File.Exists(completePath)) { completePath = null; //var renderer = new IronPdf.HtmlToPdf(); //renderer.RenderHtmlAsPdf(model.Html).SaveAs(completePath); } await _emailManager.SendLeadAsync(lead.Email, model, completePath); // await _emailManager.SendLeadAsync(lead.Email, model); return(Ok()); }
//public async Task SendLeadAsync(string email,string attachmentPath) public async Task SendLeadAsync(string email, EmailLeadModel model, string attachmentPath) { await _emailService.SendWithAttachmentAsync(email, model.Subject, model.Html, attachmentPath); }