public IActionResult updateTrainingDetails(Domain.Socioboard.Models.Training _training) { Model.DatabaseRepository dbr = new Model.DatabaseRepository(_logger, _env); _training.CreatedDate = DateTime.UtcNow; int SavedStatus = dbr.Add <Domain.Socioboard.Models.Training>(_training); if (SavedStatus == 1 && _training != null) { try { string path = _env.WebRootPath + "\\views\\mailtemplates\\plan.html"; string html = System.IO.File.ReadAllText(path); html = html.Replace("[FirstName]", _training.FirstName); html = html.Replace("[AccountType]", "Training"); _emailSender.SendMailSendGrid(_appSettings.frommail, "", _training.EmailId, "", "", "hello", html, _appSettings.SendgridUserName, _appSettings.SendGridPassword); Mailforsocioboard(_training); return(Ok("Demo Requested Added")); } catch (Exception ex) { return(Ok("Issue while sending mail.")); } } else { return(Ok("problem while saving,pls try after some time")); } }
public async Task <IActionResult> TrainingPaymentSuccessful() { Domain.Socioboard.Models.Training _training = HttpContext.Session.GetObjectFromJson <Domain.Socioboard.Models.Training>("Training"); List <KeyValuePair <string, string> > Parameters = new List <KeyValuePair <string, string> >(); Parameters.Add(new KeyValuePair <string, string>("firstname", _training.FirstName)); Parameters.Add(new KeyValuePair <string, string>("lastname", _training.LastName)); Parameters.Add(new KeyValuePair <string, string>("phoneNo", _training.PhoneNo)); Parameters.Add(new KeyValuePair <string, string>("message", _training.Message)); Parameters.Add(new KeyValuePair <string, string>("emailId", _training.EmailId)); Parameters.Add(new KeyValuePair <string, string>("company", _training.Company)); Parameters.Add(new KeyValuePair <string, string>("amount", _training.PaymentAmount.ToString())); HttpResponseMessage response = await WebApiReq.PostReq("/api/Training/updateTrainingDetails", Parameters, "", "", _appSettings.ApiDomain); if (response.IsSuccessStatusCode) { try { string returndata = await response.Content.ReadAsStringAsync(); return(Content("")); } catch { } } return(Content("")); }
public ActionResult Mailforsocioboard(Domain.Socioboard.Models.Training _training) { string path = _env.WebRootPath + "\\views\\mailtemplates\\registrationmail.html"; string html = System.IO.File.ReadAllText(path); html = html.Replace("[FirstName]", _training.FirstName); html = html.Replace("[AccountType]", "Training"); // _emailSender.SendMail("", "", "*****@*****.**", "", "", "Customer requested for demo enterprise plan ", html, _appSettings.ZohoMailUserName, _appSettings.ZohoMailPassword); _emailSender.SendMailSendGrid("", "", "*****@*****.**", "", _appSettings.ccmail, "Customer requested for demo enterprise plan ", html, _appSettings.SendgridUserName, _appSettings.SendGridPassword); return(Ok("Mail Sent Successfully.")); }
public IActionResult getTrainingDetails(string firstName, string lastName, string company, string emailId, string phoneNumber, string message, string demoPlanType, string amount) { Domain.Socioboard.Models.Training _trainingDetails = new Domain.Socioboard.Models.Training(); _trainingDetails.FirstName = firstName; _trainingDetails.LastName = lastName; _trainingDetails.Company = company; _trainingDetails.EmailId = emailId; _trainingDetails.PhoneNo = phoneNumber; _trainingDetails.Message = message; //_trainingDetails.PaymentAmount = double.Parse(amount); //HttpContext.Session.SetObjectAsJson(); //return Content(Helpers.Payment.AgencyPayment(amount, demoPlanType, firstName + " " + lastName, phoneNumber, emailId, "USD", _appSettings.paypalemail, _appSettings.callBackUrl, _appSettings.failUrl, _appSettings.AgencycallBackUrl, _appSettings.cancelurl, "", "", _appSettings.PaypalURL)); return(Ok("true")); }
public async Task <IActionResult> TrainingPlan(string firstName, string lastName, string company, string emailId, string phoneNumber, string message, string planType, string amount) { Domain.Socioboard.Models.Training _Training = new Domain.Socioboard.Models.Training(); _Training.FirstName = firstName; _Training.LastName = lastName; _Training.EmailId = emailId; _Training.Message = message; _Training.PhoneNo = phoneNumber; _Training.Company = company; // HttpResponseMessage response = await WebApiReq.PostReq("/api/Training/updateTrainingDetails", Parameters, "", "", _appSettings.ApiDomain); _Training.PaymentStatus = planType; _Training.PaymentAmount = double.Parse(amount); HttpContext.Session.SetObjectAsJson("Training", _Training); return(Content(Helpers.Payment.AgencyPayment(amount, planType, firstName + " " + lastName, phoneNumber, emailId, "USD", _appSettings.paypalemail, _appSettings.callBackUrl, _appSettings.failUrl, _appSettings.TrainingcallBackUrl, _appSettings.cancelurl, "", "", _appSettings.PaypalURL))); }