public bool SendEmailToMember(string chatTranscript) { bool emailSuccess = false; ASAMemberModel currentUser = GetMemberFromContext(); MailMessage message = new MailMessage("*****@*****.**", currentUser.Emails[0].EmailAddress); //validate chat transcript if (!CrossSiteScriptValidator.IsValidObject(chatTranscript)) { Log.Error("Failed CrossSiteScriptValidator: Possible cross site attack intercepted and save for inspection [ ", chatTranscript + " ]"); message.Dispose(); return(emailSuccess); } string messageBody = chatTranscript; message.Body = messageBody; message.IsBodyHtml = true; message.Subject = "Your Chat Transcript With Hope"; emailSuccess = UtilityFunctions.SendEmail(message); return(emailSuccess); }
public string QueUpdate(Location newlocation) { const string logMethodName = "- QueUpdate(Location location) - "; string retVal = "Queued location:" + newlocation.key; Log.Debug(logMethodName + "Begin Method"); try { string filepath = System.Configuration.ConfigurationManager.AppSettings["geolocations"]; if (!CrossSiteScriptValidator.IsValidJson(JsonConvert.Serialize(newlocation))) { Log.Error("Failed CrossSiteScriptValidator: Possible cross site attack intercepted and save for inspection [ ", JsonConvert.Serialize(newlocation) + " ]"); return("Failed Validation: the object does not conform to json standards."); } else { if (File.Exists(filepath)) { DelegateUpdateLocations callBack = new DelegateUpdateLocations(UpdateLocations); int threadId; Thread t = new Thread(() => retVal = callBack(filepath, newlocation, out threadId)); t.Start(); t.Join(WaitTime + WaitTime); } else { retVal = "Failed: file not found"; } } } catch (Exception ex) { Log.Error("Exception executing your request in QueUpdate:", ex); retVal = "Failed: with an exception executing your request in QueUpdate"; } Log.Debug(logMethodName + "End Method"); return(retVal); }