Error compiling template "/Designs/CrossControl/Paragraph/_downloadHandler.cshtml"
Line 52: The name 'EmailHandler' does not exist in the current context
Line 54: The type or namespace name 'User' could not be found (are you missing a using directive or an assembly reference?)

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System 3 @using System.IO 4 @using System.Net.Mail 5 @using System.Web 6 @using Dynamicweb; 7 @using Dynamicweb.Modules.UserManagement 8 @{ 9 var fileName = Base.Request("fileName"); 10 var firstName = Base.Request("firstname"); 11 var lastName = Base.Request("lastname"); 12 var email = Base.Request("email"); 13 var company = Base.Request("company"); 14 var phone = Base.Request("phone"); 15 16 var mailBody = ""; 17 var mailMessage = new MailMessage("noreply@crosscontrol.com", email); 18 var attachmentPath = HttpContext.Current.Server.MapPath(string.Format("{0}", fileName)); 19 var attachment = new Attachment(attachmentPath); 20 21 //mailBody += string.Format("Hej {0}<br/><br/>", name); 22 mailBody += "Thank you for showing interest in CrossControl!<br/><br/>Please find attached the requested download.<br/>If you have questions, please reach out to <a href='mailto:info@crosscontrol.com'>info@crosscontrol.com</a> or <a href='mailto:sales@crosscontrol.com'>sales@crosscontrol.com</a><br/>"; 23 24 mailMessage.Body = mailBody; 25 mailMessage.Subject = "Thanks for showing interest in CrossControl!"; 26 mailMessage.IsBodyHtml = true; 27 mailMessage.From = new MailAddress("noreply@crosscontrol.com"); 28 mailMessage.Attachments.Add(attachment); 29 30 EmailHandler.Send(mailMessage); 31 32 var u = new User 33 { 34 FirstName = firstName, 35 LastName = lastName, 36 Name = string.Format("{0} {1}", firstName, lastName), 37 Email = email, 38 Phone = phone, 39 Company = company, 40 UserName = email 41 }; 42 43 u.AddToGroup(362); 44 u.Save(); 45 } 46