public ActionResult Index(HelpViewModel helpViewModel) { Account account = new Account(); if (Request.IsAuthenticated) { var loggedInUserId = account.GetLoggedInUserId(); helpViewModel.EmailAddress = this.db.Accounts.Find(loggedInUserId).EmailAddress; } this.emailNotificationHelper.SendHelpAndSupportEmail(helpViewModel); return RedirectToAction("Index", "Help", null); }
public void SendHelpAndSupportEmail(HelpViewModel helpViewModel) { dynamic email = new Email("HelpAndSupport"); email.EmailAddress = helpViewModel.EmailAddress; email.Subject = helpViewModel.SubjectLine; email.Message = helpViewModel.Message; try { email.Send(); } catch { // Need to log when it fails, the email type and information } }