public async Task <IActionResult> OnPostAsync(ContactUsFormViewModel model) { await this.emailSender.SendEmailAsync(model.Email, WebConstants.AppMainEmailAddress, model.Subject, model.Message); this.ShowNotification(NotificationMessages.EmailSentSuccessfully, NotificationType.Success); return(RedirectToAction(nameof(HomeController.Contact), ControllersAndActionsConstants.HomeControllerName, new { area = "" })); }
public ActionResult ContactUs(ContactUsFormViewModel vm) { if (ModelState.IsValid) { TempData["RequestDispatched"] = true; } return(CurrentUmbracoPage()); }
public ActionResult ContactSave(ContactUsFormViewModel contactUsForm) { if (ModelState.IsValid) { IContactUsService services = new ContactServices(); var config = new AutoMapperConfig().Configure(); IMapper imapper = config.CreateMapper(); var contactDTO = imapper.Map <ContactUsFormViewModel, ContactUsModel>(contactUsForm); services.SaveData(contactDTO); TempData["message"] = "ContactUs Data Saved Successfully"; ModelState.Clear(); return(View()); } else { return(View(contactUsForm)); } }