public void SubscriberGet()
        {
            var subsObj = new ETSubscriber
            {
                AuthStub     = client,
                Props        = new[] { "EmailAddress", "ID" },
                SearchFilter = new SimpleFilterPart {
                    Property = "ID", Value = new[] { subscriber.ID.ToString() }, SimpleOperator = SimpleOperators.equals
                }
            };
            var response = subsObj.Get();

            Assert.AreEqual(response.Code, 200);
            Assert.AreEqual(response.Status, true);
            var subs = (ETSubscriber)response.Results[0];

            Assert.AreEqual(subs.EmailAddress, subsEmail);
        }
Esempio n. 2
0
        public ETSubscriber GetSubscriber(string email)
        {
            var getUser = new ETSubscriber
            {
                AuthStub     = SFClient,
                SearchFilter = new SimpleFilterPart
                {
                    Property       = "SubscriberKey",
                    SimpleOperator = SimpleOperators.equals,
                    Value          = new[] { email }
                }
            };
            var response = getUser.Get();

            if (response.Status && response.Results.Length > 0)
            {
                return((ETSubscriber)response.Results[0]);
            }

            return(null);
        }