public ActionResult ExportDocumentsToEmail(ExportDocumentsModel model) { try { _importExportManager.ExportDocumentsToEmail(model); TempData["export-status"] = "Documents successfully exported."; } catch (Exception ex) { CurrentRequestData.ErrorSignal.Raise(ex); TempData["export-status"] = "Documents exporting has failed. Please try again and contact system administration if error continues to appear."; } return(RedirectToAction("Documents")); }
public ExportDocumentsResult ExportDocumentsToEmail(ExportDocumentsModel model) { var queuedMessage = _messageParser.GetMessage(toAddress: model.Email); _messageParser.QueueMessage(queuedMessage, new List <AttachmentData> { new AttachmentData { Data = ExportDocumentsToExcel(), ContentType = XlsxContentType, FileName = "Documents.xlsx" } }); return(new ExportDocumentsResult { Success = true }); }