public HttpResponseMessage Post(Help value)
 {
     try
     {
         emailHelper.SendHelpEmail(value);
         return Request.CreateResponse(HttpStatusCode.OK);
     }
     catch(Exception e) {
         emailHelper.SendErrorEmail(e);
     }
     return Request.CreateResponse(HttpStatusCode.InternalServerError);
 }
Beispiel #2
0
        void IEmailHelper.SendHelpEmail(Help model)
        {
            Guard.ArgumentNotNullOrEmptyString(model.Email, "emailAddress");

            Dictionary<string, string> values = new Dictionary<string, string>();
            values.Add("EmailAddress", model.Email);
            values.Add("Subject", model.Subject);
            values.Add("Message", model.Message);

            var fileName = System.Web.HttpContext.Current.Server.MapPath(root + "Help.txt");
            var send = this as IEmailHelper;
            send.SetupEmail(values, adminEmail, fileName, model.Subject);
        }