public bool ReportarError(ReportarErrorRequest request) { var error = new ReportarErrorModel { Description = request.Mensaje, EmailAddress = request.Email, FirstName = request.Nombre, LastName = request.Apellido, Titulo = request.Titulo, WebUrl = request.WebUrl }; var usuario = Uow.Usuarios.Obtener(u => u.Identifier == request.UsuarioIdentifier); var ticket = new TicketError { EstadoTicketId = EstadoTicketEnum.Pendiente, Fecha = DateTime.Now, Mensaje = error.Description, UsuarioId = usuario.UsuarioId, Origen = OrigenTicketEnum.Desktop, Titulo = error.Titulo, Email = error.EmailAddress }; try { var result = TicketErrorNegocio.ReportarError(error, ticket); return(true); } catch (Exception) { return(false); } }
public List <EmailResult> ReportarError(ReportarErrorModel model, TicketError ticket) { Uow.TicketErrores.Agregar(ticket); Uow.Commit(); model.TicketErrorID = ticket.TicketErrorId; return(_notificationService.EnviarErrorPorMail(model)); }
public List <EmailResult> EnviarErrorPorMail(ReportarErrorModel errorData) { var mailstext = ConfigurationManager.AppSettings["ReportarErrorDevelopersEmails"]; var emails = mailstext.Split(',').ToList(); var variables = new List <merge_var> { new merge_var() { name = "FIRSTNAME", content = errorData.FirstName }, new merge_var() { name = "LASTNAME", content = errorData.LastName }, new merge_var() { name = "EMAILADDRESS", content = errorData.EmailAddress }, new merge_var() { name = "DESCRIPCION", content = errorData.Description }, new merge_var() { name = "TICKETID", content = errorData.TicketErrorID.ToString() }, new merge_var() { name = "TITULO", content = errorData.Titulo }, new merge_var() { name = "BASEURL", content = errorData.WebUrl } }; var subject = String.Format("Reporte de error [Ticket: #{0}]", errorData.TicketErrorID); return(EmailHelper.SendMailTemplate(emails, "errortemplate", variables, subject)); }
public async Task <ActionResult> ReportarError(ReportarErrorModel error) { if (!ModelState.IsValid) { return(PartialView(error)); } try { error.FirstName = UsuarioActual.Usuario.Nombre; error.LastName = UsuarioActual.Usuario.Apellido; error.WebUrl = AppSettings.BaseURL; var ticket = new TicketError { EstadoTicketId = EstadoTicketEnum.Pendiente, Fecha = DateTime.Now, Mensaje = error.Description, UsuarioId = UsuarioActual.Usuario.UsuarioId, Origen = OrigenTicketEnum.Web, Titulo = error.Titulo, Email = error.EmailAddress }; var result = TicketErrorNegocio.ReportarError(error, ticket); if (result == null) { return(PartialView("ReportarErrorFail")); } } catch (Exception ex) { EventLogger.Log(ex); return(PartialView("ReportarErrorFail")); } return(PartialView("ReportarErrorSuccess")); }