예제 #1
0
        public ActionResult Contact(ContactVM contact)
        {
            var mailer = new UserMailer();

            mailer.Contact(contact.Name, contact.Email, contact.Title, contact.Message, Server.MapPath("~/Content/images/logo-wella.png")).Send();
            Success("Mensagem enviada com sucesso! Em breve entraremos em contato com você.");
            return(RedirectToAction("Contact"));
        }
예제 #2
0
        public bool SendFeedback(MailModel model)
        {
            model.FirstName = Token.FirstName;
            model.LastName  = Token.LastName;
            model.Email     = Token.Email;
            model.Username  = Token.Username;
            UserMailer mailer = new UserMailer();

            mailer.Contact(model).Send();

            return(true);
        }
예제 #3
0
        public ActionResult Contact(ContactVM contact)
        {
            var user = MemberHelper.GetUserProfile(db);

            contact.Name  = user.PersonalInfo.Name;
            contact.Email = user.ContactInfo.Email;

            var mailer = new UserMailer();

            mailer.Contact(contact.Name, contact.Email, contact.Title, contact.Message, Server.MapPath("~/Content/images/logo-wella.png")).Send();
            Success("Mensagem enviada com sucesso! Em breve entraremos em contato com você.");
            return(RedirectToAction("Contact"));
        }
예제 #4
0
        public ActionResult Contact(ContactVM contact)
        {
            var membership = (SimpleMembershipProvider)Membership.Provider;
            var userID     = membership.GetUserId(Membership.GetUser().UserName);
            var employee   = db.Employees.First(u => u.UserID == userID);

            contact.Name  = employee.ComercialName;
            contact.CPF   = employee.CPF;
            contact.Email = employee.Email;

            var mailer = new UserMailer();

            mailer.Contact(contact.Name, contact.CPF, contact.Email, contact.Title, contact.Message, Server.MapPath("~/Content/images/logo-with-products-smaller.png")).Send();
            Success("Mensagem enviada com sucesso! Em breve entraremos em contato com você.");
            return(RedirectToAction("Contact"));
        }
예제 #5
0
        public HttpResponseMessage Contact(MailModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }

            if (Request.Headers.Authorization.ToString() != ConfigurationManager.AppSettings["AuthorizationHeader"])
            {
                return(Request.CreateResponse(HttpStatusCode.Unauthorized));
            }

            var mailer = new UserMailer();

            mailer.Contact(model).Send();

            return(Request.CreateResponse(HttpStatusCode.OK));
        }