コード例 #1
0
ファイル: LeadController.cs プロジェクト: Ehetesham1602/Crm
        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());
        }
コード例 #2
0
ファイル: EmailManager.cs プロジェクト: Ehetesham1602/Crm
 //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);
 }