protected void Adduser_WL(int SiteID, string Mail, string FullName) { bool tmp = false; SendMsgResults _res = new SendMsgResults(); SendMsgService _svc = new SendMsgService(); _svc.AddUsersOnly(SiteID, true, "IL110077", new SendMsgUser[] { new SendMsgUser() { EmailAddress = Mail, UserSystemFields = new SendMsgFields[2] { new SendMsgFields() { Key = "שם", Value = FullName }, new SendMsgFields() { Key = "נרשם דרך פייסבוק", Value = "1" } } } }, out tmp, out tmp, out _res); if (_res.ResultMessage.Contains("Failed:1")) { using (MySqlConnection conn = new MySqlConnection(cmstrDefualts.ConnStr)) { conn.Open(); LoginUser.NotAddedToISend(Mail, conn); } } }
protected void Adduser_WL(int SiteID, string Mail, string FullName, int ListID) { bool tmp; bool AddUsersToListResult; SendMsgResults _res = new SendMsgResults(); SendMsgService _svc = new SendMsgService(); List <SendMsgUser> _UsersList = new List <SendMsgUser>(); List <SendMsgList> _mailList = new List <SendMsgList>(); _mailList.Add(new SendMsgList() { ExistingListID = ListID, ExistingListIDSpecified = true }); _UsersList.Add(new SendMsgUser() { EmailAddress = Mail, UserSystemFields = new SendMsgFields[1] { new SendMsgFields() { Key = "שם", Value = FullName } } }); _svc.AddUsersToLists(SiteID, true, "IL110077", _UsersList.ToArray(), _mailList.ToArray(), out AddUsersToListResult, out tmp, out _res); }
protected void Adduser_WL(int SiteID, string Mail, string FullName, int ListID, string sendurl) { bool tmp; bool AddUsersToListResult; SendMsgResults _res = new SendMsgResults(); SendMsgService _svc = new SendMsgService(); List <SendMsgUser> _UsersList = new List <SendMsgUser>(); List <SendMsgList> _mailList = new List <SendMsgList>(); //_mailList.Add(new SendMsgList() { ExistingListID = ListID, ExistingListIDSpecified = true }); _mailList.Add(new SendMsgList() { ExistingListID = 55, ExistingListIDSpecified = true }); _UsersList.Add(new SendMsgUser() { EmailAddress = Mail, UserSystemFields = new SendMsgFields[4] { new SendMsgFields() { Key = "שם", Value = FullName }, new SendMsgFields() { Key = "קישור הרשמה", Value = sendurl }, new SendMsgFields() { Key = "נרשם דרך מייל", Value = "1" }, new SendMsgFields() { Key = "מהיכן נרשם", Value = FromToIsender } } }); _svc.AddUsersToLists(SiteID, true, "IL110077", _UsersList.ToArray(), _mailList.ToArray(), out AddUsersToListResult, out tmp, out _res); }
//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 SignByMailLinkButton_Click(object sender, EventArgs e) { bool isExists = false; string email = SendByMailTextBox.Text.Replace("'", "''"); SendByMailTextBox.Text = ""; using (MySqlConnection conn = new MySqlConnection(cmstrDefualts.ConnStr)) { conn.Open(); string sql = String.Format("Select UserID From tblusers where (EmailAddress='{0}' OR LoginMailAddress='{0}') AND (EmailAddress<>'{1}') ", email, _usermail); MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { isExists = true; } dr.Close(); if (!isExists) { cmd.CommandText = String.Format("Update tblusers Set EmailAddress='{0}' , SignInByMail=1 where EmailAddress='{1}'", email, _usermail); Session["LoggedUserMail"] = email; cmd.ExecuteNonQuery(); Badge.AddBadge(BadgTypeEnum.Join, conn, Session["LoggedUserMail"].ToString()); bool tmp; bool AddUsersToListResult; SendMsgService svc = new SendMsgService(); SendMsgResults resSendMsgResults = new SendMsgResults(); List <SendMsgUser> _UsersList = new List <SendMsgUser>(); _UsersList.Add(new SendMsgUser() { EmailAddress = email, UserSystemFields = new SendMsgFields[2] { new SendMsgFields() { Key = "שם", Value = User_Fullname }, new SendMsgFields() { Key = "נרשם דרך מייל", Value = "1" } } }); svc.AddUsersOnly(5078, true, "IL110077", _UsersList.ToArray(), out tmp, out AddUsersToListResult, out resSendMsgResults); Response.Redirect("./"); } else { maillerror.Text = "mail exists!!!"; } } }
protected void Adduser_WL(int SiteID, string Mail, string FullName) { string groupid = ""; if (Request.Cookies["JoinUsGroup"] != null) { groupid = Request.Cookies["JoinUsGroup"].Value; } int groupidInt; if (!int.TryParse(groupid, out groupidInt)) { groupidInt = 19; } bool tmp = false; bool tmp2 = false; SendMsgResults _res = new SendMsgResults(); SendMsgService _svc = new SendMsgService(); List <SendMsgList> _mailList = new List <SendMsgList>(); List <SendMsgUser> _UsersList = new List <SendMsgUser>(); _UsersList.Add(new SendMsgUser() { EmailAddress = Mail, UserSystemFields = new SendMsgFields[2] { new SendMsgFields() { Key = "שם", Value = FullName }, new SendMsgFields() { Key = "נרשם דרך פייסבוק", Value = "1" } } }); _mailList.Add(new SendMsgList() { ExistingListID = groupidInt, ExistingListIDSpecified = true }); _svc.AddUsersToLists(SiteID, true, "IL110077", _UsersList.ToArray(), _mailList.ToArray(), out tmp2, out tmp, out _res); if (_res.ResultMessage.Contains("Failed:1")) { using (MySqlConnection conn = new MySqlConnection(cmstrDefualts.ConnStr)) { conn.Open(); LoginUser.NotAddedToISend(Mail, conn); } } }
protected void Adduser_WL(int SiteID, string Mail, string FullName) { bool tmp = false; SendMsgResults _res = new SendMsgResults(); SendMsgService _svc = new SendMsgService(); _svc.AddUsersOnly(SiteID, true, "IL110077", new SendMsgUser[] { new SendMsgUser() { EmailAddress = Mail, UserSystemFields = new SendMsgFields[1] { new SendMsgFields() { Key = "שם", Value = FullName } } } }, out tmp, out tmp, out _res); }
protected void Adduser_WL(int SiteID, string Mail, string FullName, int ListID, string sendurl) { bool tmp; bool AddUsersToListResult; SendMsgResults _res = new SendMsgResults(); SendMsgService _svc = new SendMsgService(); List <SendMsgUser> _UsersList = new List <SendMsgUser>(); List <SendMsgList> _mailList = new List <SendMsgList>(); _mailList.Add(new SendMsgList() { ExistingListID = ListID, ExistingListIDSpecified = true }); //_mailList.Add(new SendMsgList() { ExistingListID = 55, ExistingListIDSpecified = true }); _UsersList.Add(new SendMsgUser() { EmailAddress = Mail }); _svc.AddUsersToLists(SiteID, true, "IL110077", _UsersList.ToArray(), _mailList.ToArray(), out AddUsersToListResult, out tmp, out _res); }