//private static SendMsgService service = null; public static DataProResult SendCouponEmail(string email, ref API_Project_GetResult project) { SendMsgService service = new il.co.sendmsg.api3.SendMsgService(); SendMsgResults result = null; try { SendMsgUser USER = new SendMsgUser() { EmailAddress = email }; SendMsgMessage MSG = new SendMsgMessage() { MessageType = SendMsgMessageType.MailMessage, MessageID = int.Parse(project.Coupon_EmailID) }; SendMsgUser[] _u = new SendMsgUser[1] { USER }; SendMsgList msglist = new SendMsgList(); msglist.ExistingListID = project.Coupon_GroupID.GetValueOrDefault(); SendMsgList[] _msglist = new SendMsgList[1] { msglist }; MSG.MessageIDSpecified = true; bool add_users_and_send_result = false; bool add_users_and_send_specified = false;; service.AddUsersAndSend(project.Coupon_SiteID.GetValueOrDefault(), true, project.Coupon_APIPassword, _u, MSG, out add_users_and_send_result, out add_users_and_send_specified, out result); return(new DataProResult() { CodeResult = result.ResultID, result = result, add_and_send = add_users_and_send_result, add_and_send_specified = add_users_and_send_specified }); } catch (Exception ex) { return(new DataProResult() { CodeResult = -1, exMSG = UtilsException.GetMSG(ref ex), result = result }); } }
protected void Page_Load(object sender, EventArgs e) { if (!Request.Url.ToString().StartsWith("https://israelikers.org") && !Request.Url.ToString().Contains("localhost:")) { Response.Redirect("https://israelikers.org" + Request.Url.PathAndQuery); } else { } if (!string.IsNullOrEmpty(Request.QueryString["lang"])) { _UserLang = Request.QueryString["lang"].ToString(); } if (!string.IsNullOrEmpty(Request.QueryString["mail"])) { _Usermail = Request.QueryString["mail"].ToString(); } if (_Usermail == "") { Panel_Error.Visible = true; } if (_Usermail != "") { bool _userAllowed = false; bool _userAllowed2 = false; SendMsgService _srvc = new SendMsgService(); SendMsgList _lst = new SendMsgList(); _srvc.CheckIfUserExistsByMail2(5078, true, _Usermail, out _userAllowed, out _userAllowed2); if (!_userAllowed) { Response.Redirect("./"); } using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr)) { con.Open(); MySqlCommand _cmd = new MySqlCommand(); _cmd.Connection = con; _cmd.CommandText = "select * from tblusers where EmailAddress='" + _Usermail + "'"; MySqlDataReader _dr = _cmd.ExecuteReader(); if (_dr.HasRows) { _UserExists = true; } _dr.Close(); } if (_UserLang == "") { _UserLang = "Heb"; } if (!_UserExists) { switch (_UserLang.ToLower()) { case "heb": Panel_HebReg.Visible = true; ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text = _Usermail; MyFormHeb.BackURL = "FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang; break; case "eng": Panel_EngReg.Visible = true; ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormEng.FindControl("txtMail")).Text = _Usermail; MyFormEng.BackURL = "FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang; break; default: break; } } else { Response.Redirect("FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang); if (_UserLang == "Heb") { Panel_HebExists.Visible = true; ProceedLinkHeb.HRef = "FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang; } else { Panel_EngExists.Visible = true; ProceedLinkEng.HRef = "FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang; } } MyFormHeb.BackURL = "FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang; } }