@@ -251,7 +251,7 @@ private async Task UpdateManagedCertificateStatus(ManagedCertificate managedCert
251251 /// </summary>
252252 /// <param name="managedCertificate"></param>
253253 /// <returns></returns>
254- private async Task ReportManagedCertificateStatus ( ManagedCertificate managedCertificate )
254+ private async Task ReportManagedCertificateStatus ( ManagedCertificate managedCertificate , bool removeReport = false )
255255 {
256256
257257 var reportedCert = Newtonsoft . Json . JsonConvert . DeserializeObject < ManagedCertificate > ( Newtonsoft . Json . JsonConvert . SerializeObject ( managedCertificate ) ) ;
@@ -273,7 +273,8 @@ private async Task ReportManagedCertificateStatus(ManagedCertificate managedCert
273273 PrimaryContactEmail = ( await GetAccountDetails ( managedCertificate , allowFailover : false ) ) ? . Email ,
274274 ManagedSite = reportedCert ,
275275 AppName = _isMgtmHubBackend ? "Certify Management Hub" : "Certify Certificate Manager" ,
276- AppVersion = Util . GetAppVersion ( ) . ToString ( )
276+ AppVersion = Util . GetAppVersion ( ) . ToString ( ) ,
277+ IsRemoved = removeReport
277278 } ;
278279
279280 if ( ! _useStatusReportQueue )
@@ -344,6 +345,12 @@ public async Task<ActionResult> DeleteManagedCertificate(string id)
344345 if ( item != null )
345346 {
346347 await _itemManager . Delete ( item ) ;
348+
349+ if ( item . RequestConfig ? . EnableFailureNotifications == true && CoreAppSettings . Current . EnableStatusReporting )
350+ {
351+ await ReportManagedCertificateStatus ( item , removeReport : true ) ;
352+ }
353+
347354 return new ActionResult { IsSuccess = true , Message = "Deleted" } ;
348355 }
349356 }
0 commit comments