Ejemplo n.º 1
0
        public virtual MvcMailMessage ContactMe(OusmaneLoumContactMeModel ousmaneLoumContactMeModel)
        {
            ViewBag.Name      = ousmaneLoumContactMeModel.Name;
            ViewBag.FromEmail = ousmaneLoumContactMeModel.FromEmail;
            ViewBag.Message   = ousmaneLoumContactMeModel.Message;

            return(Populate(x =>
            {
                x.Subject = " New Message Received from OusmaneLoum.Com";
                x.ViewName = "ContactMe";
                x.To.Add(ousmaneLoumContactMeModel.ToEmail);
            }));
        }
        public HttpResponseMessage Send(HttpRequestMessage request, [FromBody] OusmaneLoumContactMeModel ousmaneLoumContactMeModel)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                ousmaneLoumContactMeModel.ToEmail = "*****@*****.**";
                Mailer.ContactMe(ousmaneLoumContactMeModel).Send();

                response = request.CreateResponse <String>(HttpStatusCode.OK, "Success");

                return response;
            }));
        }