Пример #1
0
        //Check whether Ectractor set completed (w/ or w/o errors) and send email
        private void VerifyAndSendEmailForExtractorSetComplete(string[] emailRecepients)
        {
            string extractorSetStatus = ArtifactQueries.GetExtractorSetStatus(ServicesMgr, ExecutionIdentity, WorkspaceArtifactId, ExtractorSetArtifactId);

            if (extractorSetStatus.Equals(Constant.ExtractorSetStatus.COMPLETE) || extractorSetStatus.Equals(Constant.ExtractorSetStatus.COMPLETE_WITH_ERRORS))
            {
                SmtpSettings smtpSettings = SqlQueryHelper.GetSmptSettings(EddsDbContext);
                if (smtpSettings != null)
                {
                    EmailUtility emailUtility             = new EmailUtility(smtpSettings);
                    String       extractorSetNameForEmail = ArtifactQueries.GetExtractorSetNameForArtifactId(ServicesMgr, ExecutionIdentity, WorkspaceArtifactId, ExtractorSetArtifactId);
                    String       extractorSetEmailBody    = String.Format("This is an automatic notification from Field Finder application.\r\nExtraction set [{0}] completed with status [{1}].", extractorSetNameForEmail, extractorSetStatus);
                    emailUtility.SendEmailNotificationForExtractionSet(extractorSetEmailBody, extractorSetNameForEmail, emailRecepients);
                }
            }
        }