private void ActionsOnSuccess(ContactFormModel model) { var settingsNode = Umbraco.TypedContent(1600); var settings = new EmailSettings { To = settingsNode.Get(Up.Mixins.EmailSettings.RecipientEmailAddress), From = settingsNode.Get(Up.Mixins.EmailSettings.SenderEmailAddress), Subject = settingsNode.Get(Up.Mixins.EmailSettings.DefaultSubjectField) }; //repository.Save(model); emailService.Send(model, Settings.DefaultEmailTemplate, settings); }
public ActionResult Send(ContactFormModel model) { const string successMessage = "Your form was successfully submitted"; if (!ModelState.IsValid) { return CurrentUmbracoPage(); } ActionsOnSuccess(model); TempData.Add("Message", successMessage); return Redirect(RedirectToCurrentUmbracoPage().Url + "#contactanchor"); }