public ActionResult Submit(FormCollection collection) { if (!Crypto.CheckMinuteCypher(Request["cd"], 60)) { Web.InfoMessage = "Are you a robot? if not please try the form again."; return(Redirect(Web.Root + "ContactUs?mode=token")); } var data = new ViewModel(); data.ContentPage = Models.Page.LoadOrCreatePageCode("ContactUs"); if (data.ContentPage == null) { throw new Exception("Contact Us page not found"); } var contactUs = new ContactUs(); contactUs.UpdateFromRequest(); contactUs.Save(); data.ContactDetails = contactUs; SendContactEmail(contactUs); var thankYouMsg = new Beweb.TextBlock("Contact Us Thank You Msg"); return(View("ContactUsThanks", data)); }
private void SendApprovalEmail(Page record) { Person toPerson = Person.LoadByPersonID((int)record.RequestApprovalForPersonID); var email = new ElectronicMail(); email.ToAddress = toPerson.Email; var textBlock = new Beweb.TextBlock("Email: Page Approval Request", "Page Approval Request", @"Dear [--publisherName--], [--editorName--] requested approval on a page. Please click [--url--] to review. Thanks."); email.Subject = textBlock.Title; var body = textBlock.RawBody; body = body.Replace("[--publisherName--]", toPerson.FirstName); body = body.Replace("[--editorName--]", UserSession.Person.FirstName); body = body.Replace("[--url--]", record.GetAdminFullUrl()); email.FromAddress = Util.GetSetting("EmailFromAddress", "*****@*****.**"); email.BodyPlain = body; email.Send(true); }