private void ExecuteSendFeedbackEmail(object sender, ExecutedRoutedEventArgs e) { var mailItem = new MailItem { RecipientTo = (Settings.Default.RecipientTo), RecipientCC = (Settings.Default.RecipientCC), RecipientBCC = (Settings.Default.RecipientBCC), Subject = (Settings.Default.EmailSubject), Attachement = Logger.LogFile, Body = Logger.LogFile }; EmailCreation.CreateEmail(mailItem); }
public ActionResult SendTickets() { if (TempData["user"] != null) { var userJson = JsonConvert.DeserializeObject(TempData["user"].ToString()); JToken token = JObject.Parse(userJson.ToString()); User user = new UserBuilder() .SetId((long)token.SelectToken("Id")) .SetUsername((string)token.SelectToken("Username")) .Build(); TempData["user"] = JsonConvert.SerializeObject(user); var tickets = ticketService.GetTicketsByUser(user.GetId()); FileStream file = PdfFileGenerator.GeneratePdfTickets(tickets); EmailCreation.SendEMail(file.Name, user.GetUsername()); return(RedirectToAction("Events")); } return(StatusCode(404)); }