From 7e3a5b8c4599054793a7c380a9223a494196a9f2 Mon Sep 17 00:00:00 2001 From: Anjana Yadav Date: Fri, 19 Jul 2024 16:25:29 -0700 Subject: [PATCH] Removed nuget and code for pdf generation --- .../OFM.Infrastructure.WebAPI.csproj | 1 - .../Processes/Emails/IEmailRepository.cs | 31 ------------------- 2 files changed, 32 deletions(-) diff --git a/OFM.Infrastructure.WebAPI/OFM.Infrastructure.WebAPI.csproj b/OFM.Infrastructure.WebAPI/OFM.Infrastructure.WebAPI.csproj index b4e166c4..e7493f62 100644 --- a/OFM.Infrastructure.WebAPI/OFM.Infrastructure.WebAPI.csproj +++ b/OFM.Infrastructure.WebAPI/OFM.Infrastructure.WebAPI.csproj @@ -58,7 +58,6 @@ - diff --git a/OFM.Infrastructure.WebAPI/Services/Processes/Emails/IEmailRepository.cs b/OFM.Infrastructure.WebAPI/Services/Processes/Emails/IEmailRepository.cs index f37ab2ce..0cc0f0a8 100644 --- a/OFM.Infrastructure.WebAPI/Services/Processes/Emails/IEmailRepository.cs +++ b/OFM.Infrastructure.WebAPI/Services/Processes/Emails/IEmailRepository.cs @@ -384,38 +384,7 @@ public async Task CreateAllowanceEmail(SupplementaryApplication allowance, if (newEmailId != null) await NotificationSentSupp(allowance.ofm_allowanceid, _d365webapiservice, processId); - #region generate pdf for the email sent for approval - subject = "
 
Subject: " + subject + "



"; - emaildescription = string.Concat(Environment.NewLine, subject, Environment.NewLine, emaildescription); - SelectPdf.HtmlToPdf converter = new SelectPdf.HtmlToPdf(); - try - { - SelectPdf.HtmlToPdfOptions options = new HtmlToPdfOptions(); - converter.Options.MarginTop = 100; converter.Options.MarginLeft = 50; converter.Options.MarginRight = 40; converter.Options.MarginBottom = 10; - converter.Options.PdfPageOrientation = PdfPageOrientation.Landscape; - converter.Options.PdfPageSize = PdfPageSize.A4; - SelectPdf.PdfDocument doc = converter.ConvertHtmlString(emaildescription); - byte[] bytes = doc.Save(); - HttpResponseMessage response1 = await _d365webapiservice.SendDocumentRequestAsync(_appUserService.AZPortalAppUser, ofm_allowance.EntitySetName, (Guid)allowance.ofm_allowanceid, bytes, string.Concat(allowanceNumber, ".pdf")); - - if (!response1.IsSuccessStatusCode) - { - var responseBody = await response1.Content.ReadAsStringAsync(); - _logger.LogError(CustomLogEvent.Process, "Failed to create notification pdf for approved supplementary the server error {responseBody}", responseBody.CleanLog()); - - //log the error - return await Task.FromResult(false); - - } - } - catch (Exception ex) - { - _logger.LogError(CustomLogEvent.Process, "Failed to create notification pdf for approved supplementary {responseBody}", ex.InnerException.Message); - - } - - #endregion } if (allownaceStatusReason == (int)ofm_allowance_StatusCode.DeniedIneligible)