public UserInfoEmailTemplate(UserInfo data)
            : base(data)
        {
            var html = new TagBuilder("html");
            var body = new TagBuilder("body");
            var table = new TagBuilder("table");
            var tr1 = new TagBuilder("tr");
            var tr2 = new TagBuilder("tr");
            var tr3 = new TagBuilder("tr");
            var tr4 = new TagBuilder("tr");
            var tr5 = new TagBuilder("tr");
            var tr6 = new TagBuilder("tr");
            var tr7 = new TagBuilder("tr");

            var td1 = new TagBuilder("td");
            var td2 = new TagBuilder("td");

            td1.SetInnerText("Имя");
            td2.SetInnerText(data.FirstName);
            tr1.InnerHtml = td1.ToString() + td2;

            td1.SetInnerText("Фамилия");
            td2.SetInnerText(data.LastName);
            tr2.InnerHtml = td1.ToString() + td2;

            td1.SetInnerText("Отчество");
            td2.SetInnerText(data.MiddleName);
            tr3.InnerHtml = td1.ToString() + td2;

            td1.SetInnerText("Дата рождения");
            td2.SetInnerText(data.DateOfBirth.ToString());
            tr4.InnerHtml = td1.ToString() + td2;

            td1.SetInnerText("Почта");
            td2.SetInnerText(data.Email);
            tr5.InnerHtml = td1.ToString() + td2;

            td1.SetInnerText("Телефон");
            td2.SetInnerText(data.Phone);
            tr6.InnerHtml = td1.ToString() + td2;

            td1.SetInnerText("Скайп");
            td2.SetInnerText(data.Skype);
            tr7.InnerHtml = td1.ToString() + td2;

            table.InnerHtml = tr1.ToString() + tr2 + tr3 + tr4 + tr5 + tr6 + tr7;
            body.InnerHtml = table.ToString();
            html.InnerHtml = body.ToString();

            HtmlString = html.ToString(TagRenderMode.Normal);
        }
        public JsonResult SendRequest(UserInfo model)
        {
            try
            {
                var emails = _settingsService.GetSettings().Emails.Split(new[] { ',' }).ToList();

                _emailService.SendEmail(
                    emails,
                    model.Email,
                    new UserInfoEmailTemplate(model));

                return Json(new { status = HttpStatusCode.OK, message = GlobalResources.SendRequestSuccess });
            }
            catch (Exception e)
            {
                return Json(new { status = HttpStatusCode.InternalServerError, message = GlobalResources.SendRequestError });
            }
        }
 public RequestViewModel(string content)
     : base(content)
 {
     UserInfo = new UserInfo();
 }