        public static bool ScheduledReportExecuteSuccess(SessionInfo sessionInfo) {

            bool interrupt = false; // return value 

            string envDir = Environment.GetEnvironmentVariable("EXAGO_ENVDIR");

            string archiveFolder = ConfigurationManager.AppSettings["ArchiveFolder"];
            string s3ApiKey = ConfigurationManager.AppSettings["S3ApiKey"];
            string s3ApiPrivateKey = ConfigurationManager.AppSettings["S3ApiPrivateKey"];
            string smtpHost = ConfigurationManager.AppSettings["SmtpHost"];
            string smtpPort = ConfigurationManager.AppSettings["SmtpPort"];
            string smtpSsl = ConfigurationManager.AppSettings["SmtpSsl"];
            string smtpUser = ConfigurationManager.AppSettings["SmtpUser"];
            string smtpPassword = ConfigurationManager.AppSettings["SmtpPassword"];
            string mailFrom = ConfigurationManager.AppSettings["MailFrom"];
            string mailFromName = ConfigurationManager.AppSettings["MailFromName"];
            
            string archivePath = archiveFolder + @"\" + sessionInfo.CompanyId 
                + @"\" + DateTime.Now.ToString("yyyy_MM_dd") + "_" + Path.GetFileName(sessionInfo.Report.DownloadFn);

            string s3Key = "Report_Archive" + "/" + envDir + "/" + sessionInfo.CompanyId
                + "/" + DateTime.Now.ToString("yyyy_MM_dd") + "_" + Path.GetFileName(sessionInfo.Report.DownloadFn);

            var scheduleInfo = sessionInfo.ReportSchedulerService.SchedulerJob.ScheduleInfo;


            if (sessionInfo.Report.ExecuteDataRowCount == 0) { // NO DATA FOUND!! 
                interrupt = true; // stop Exago from emailing this attachments

                SmtpClient client = new SmtpClient();
                client.Host = smtpHost;
                if (smtpPort != "") {
                    client.Port = Int32.Parse(smtpPort);
                }
                client.UseDefaultCredentials = false;
                client.EnableSsl = (smtpSsl == "true") ? true : false;
                client.Credentials = new System.Net.NetworkCredential(smtpUser, smtpPassword);

                MailMessage mail = new MailMessage();
                mail.From = new MailAddress(mailFrom, mailFromName); // from configuration 

                foreach (var email in scheduleInfo.EmailToList) {
                    mail.To.Add(email);
                }
                foreach (var email in scheduleInfo.EmailCcList) {
                    mail.CC.Add(email);
                }
                foreach (var email in scheduleInfo.EmailBccList) {
                    mail.Bcc.Add(email);
                }
                var reportName = scheduleInfo.ReportName.Split('\\').Last(); // just the last part
                mail.Subject = scheduleInfo.EmailSubject;
                mail.IsBodyHtml = true;
                mail.Body = "Hello<br /><br />"
                          + "The report <b>" + reportName + "</b> was scheduled to be sent to you today. "
                          + "But when the report ran, there was no data that fit its defined criteria.<br /><br />"
                          + "As a result, the report will not be sent.<br /><br />"
                          + "Please contact your organization's DonorPerfect administrator for more information.<br /><br />"
                          + "Thank you,<br />"
                          + "The DonorPerfect Team<br />";  
                client.Send(mail);
            }
            else {
                FileInfo fileInfo = new FileInfo(sessionInfo.Report.DownloadFn);


                if (fileInfo.Exists) { // save to archive
                    using (IAmazonS3 s3Client = new AmazonS3Client(s3ApiKey, s3ApiPrivateKey, RegionEndpoint.USEast1)) {
                        PutObjectRequest request = new PutObjectRequest {
                            BucketName = "dpo",
                            Key = s3Key,
                            FilePath = sessionInfo.Report.DownloadFn
                        };
                        PutObjectResponse response = s3Client.PutObject(request);
                    }
                    //output file are in S3, we don't need them in the file system
                    //Directory.CreateDirectory(Path.GetDirectoryName(archivePath));
                    //File.Copy(sessionInfo.Report.DownloadFn, archivePath, true); // make a copy of the file
                    if (fileInfo.Length > 12000000) { // too large for email, inform support
                        interrupt = true; // stop Exago from emailing this attachments
                        SmtpClient client = new SmtpClient();
                        client.Host = smtpHost;
                        if (smtpPort != "") {
                            client.Port = Int32.Parse(smtpPort);
                        }
                        client.UseDefaultCredentials = false;
                        client.EnableSsl = (smtpSsl == "true") ? true : false;
                        client.Credentials = new System.Net.NetworkCredential(smtpUser, smtpPassword);

                        MailMessage mail = new MailMessage();
                        mail.From = new MailAddress(mailFrom, mailFromName); // from configuration 
                        foreach (var email in scheduleInfo.EmailToList) {
                            mail.To.Add(email);
                        }
                        foreach (var email in scheduleInfo.EmailCcList) {
                            mail.CC.Add(email);
                        }
                        foreach (var email in scheduleInfo.EmailBccList) {
                            mail.Bcc.Add(email);
                        }
                        var reportName = scheduleInfo.ReportName.Split('\\').Last(); // just the last part
                        mail.Subject = scheduleInfo.EmailSubject;
                        mail.IsBodyHtml = true;
                        mail.Body = "Hello<br /><br />"
                                  + "The report <b>" + reportName + "</b> was scheduled to be sent to you today. "
                                  + "We ran the report, but it exceeds the file size limit on your email inbox.<br /><br />"
                                  + "As a result, you will not receive this report.<br /><br />"
                                  + "Please contact your organization's DonorPerfect administrator for more information.<br /><br />"
                                  + "Thank you,<br />"
                                  + "The DonorPerfect Team<br />"; 
                        client.Send(mail);
                    }
                }
            }
            return interrupt; 
        }