public JsonResult SendCURL(CustomerDocumentURL curl) { curl = _documentRepository.GetCURL(curl.URLKey); Customer customer = _customerRepository.Get(curl.CustomerId); bool result = SendCURL(curl, customer); var res = new Dictionary<String, Object> {{"success", result}}; return Json(res); }
private bool SendCURL(CustomerDocumentURL curl, Customer customer) { var client = new SmtpClient("localhost"); string hosturl = ConfigurationManager.AppSettings["HostUrl"]; string url = string.Format("{0}{1}{2}", hosturl, "/Document/CURL?guid=", curl.URLKey); string toAddr = customer.PrimaryContactEmail; string fromAddr = ConfigurationManager.AppSettings["CustomerSupportEmailAddress"]; var mailMessage = new MailMessage(fromAddr, toAddr) { Subject = "New PRTools Document: " + curl.Title, Body = string.Format( "Copy and paste URL into browser to view and edit this PR Release: {0}", url) }; try { client.Send(mailMessage); curl.Status = CustomerDocumentURLStatus.OutForReview; _documentRepository.Update(curl); return true; } catch (Exception e) { return false; } }
public JsonResult SaveCustomerUrlDocument(CustomerDocumentURL curl) { _documentRepository.Update(curl); var res = new Dictionary<String, Object> {{"success", true}}; return Json(res); }