public ActionResult SubmitQuery(string Name, string Organization, string Email, string PhoneNumber) { try { var EmailData = BL_tblEmailSettingsM.GetRecord("RevenueManager"); FutureSoft.Util.MailComponent.SendEmail(EmailData.sEmail.Split(',')[0] /*"*****@*****.**"*/, "", null, "Query - One Fine Rate Contact", "New Query has been came from a user, Please Find Details Below \n Name : " + Name + "\n Organization : " + Organization + "\n Email Address : " + Email + "\n Phone Number : " + PhoneNumber, null, null, true, null, null); return(Json(true, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(false, JsonRequestBehavior.AllowGet)); throw; } }
public int SendMailToRevenueManager(int bookingId) { try { var customerModel = new NegotiationEmailTempleteModel(); // Added to show hotel Information in email template var bookingModel = BL_Booking.GetBookingModifyDetails_Notifications(bookingId); customerModel.BookingModify = bookingModel; Decimal?ExchangeRate = 1; // get from tblEmailSetting var revenueManagerDetail = BL_tblEmailSettingsM.GetRecord("RevenueManager"); // get from propertyEdit page var pRevenueManager = BL_PropDetails.GetEmail_PhoneByPropId(bookingModel.PropId); string sPrimaryContactEmail; string sConfirmationContactEmail; string sRevenueManagerEmail; string sRevenueManagerContact; pRevenueManager.TryGetValue("sPrimaryContactEmail", out sPrimaryContactEmail); pRevenueManager.TryGetValue("sConfirmationContactEmail", out sConfirmationContactEmail); pRevenueManager.TryGetValue("sRevenueManagerEmail", out sRevenueManagerEmail); pRevenueManager.TryGetValue("sRevenueManagerContact", out sRevenueManagerContact); string emails = sRevenueManagerEmail + "," + sConfirmationContactEmail + "," + sPrimaryContactEmail; customerModel = new NegotiationEmailTempleteModel(); customerModel.BookingModify = bookingModel; //customerModel.Status = "Thanks " + bookingModel.Booker + "! We have recieved your negotiation." + Environment.NewLine + "We will get back to you within 3 hours."; customerModel.Status = "Thank you " + bookingModel.Booker + "! We have recieved your bargain." + Environment.NewLine + bookingModel.sMessage; var revenuManagerModel = new NegotiationEmailTempleteModel(); //revenuManagerModel.Status = "Hi " + revenueManageName +", Please take action for the following Negotiation Request."; revenuManagerModel.Status = "Hi, Please take action for the following bargain Request."; revenuManagerModel.IsRevenueManagerFormat = true; if (bookingModel.sCurrencyCode != "INR") { etblExchangeRatesM objExchange = BL_ExchangeRate.GetSingleRecordById("INR", bookingModel.sCurrencyCode); if (objExchange.dRate != null) { ExchangeRate = 1 / objExchange.dRate; } } bookingModel.dTotalNegotiateAmount = bookingModel.dTotalNegotiateAmount * ExchangeRate; bookingModel.dTaxes = Convert.ToDecimal(bookingModel.Tax) * Convert.ToDecimal(ExchangeRate); revenuManagerModel.BookingModify = bookingModel; string extranetUrl = Request.Url.GetLeftPart(UriPartial.Authority) + "Account/Login?sPropId=" + clsUtils.Encode(bookingModel.PropId.ToString()); string shortExtranetUrl = clsUtils.Shorten(extranetUrl); string notificationMsg_RevenueMgr = "You have received a new bargain offer. The guest has chosen your hotel! Click " + shortExtranetUrl + " to view the offer and process yet another reservation from OFR. This offer is valid for the next three hours."; var html_RevenueManager = this.RenderViewToString("_NegotiationEmailTemplete", revenuManagerModel); Task.Run(() => clsUtils.sendSMS(sRevenueManagerContact, notificationMsg_RevenueMgr)); Task.Run(() => MailComponent.SendEmail(sRevenueManagerEmail, revenueManagerDetail.sEmail, "", "Reminder - New Bargain", html_RevenueManager, null, null, true, null, null)); return(1); } catch (Exception ex) { return(0); } }