Example #1
0
        private async Task ReportToAdmin(string vaultId, string message)
        {
            var vaultAdmin = await _vaultManager.GetVaultAdmin(vaultId);

            var userEmail = (await UserManager.FindByIdAsync(vaultAdmin.Id)).Email;

            _mailtReporter.MailTo = userEmail;
            new Thread(async() => await _mailtReporter.Report($"{DateTime.Now}: {message}")).Start();
        }
Example #2
0
        public async Task <ActionResult> Unload(EmailViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (Session != null)
                {
                    var orders   = (IEnumerable <OrderToUnload>)Session["Orders"];
                    var fileName = await _orderManager.UnloadToExcel(orders);

                    _reporter.MailTo = model.MailTo;
                    await _reporter.Report(fileName);

                    return(RedirectToAction("Unload"));
                }
            }
            return(PartialView("_UnloadButton", model));
        }