예제 #1
0
        public ETSubscriber UpdateSubscriber(ETSubscriber subscriber)
        {
            if (String.IsNullOrEmpty(subscriber.SubscriberKey))
            {
                return(null);
            }

            subscriber.AuthStub = SFClient;
            var response = subscriber.Patch();

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

            return(null);
        }
예제 #2
0
        public void SubscriberUpdate()
        {
            var subsObj = new ETSubscriber
            {
                AuthStub      = client,
                EmailAddress  = subsEmail,
                SubscriberKey = subsKey,
                Attributes    = new[] { new ETProfileAttribute {
                                            Name = "FullName", Value = "Updated FullName"
                                        } }
            };
            var response = subsObj.Patch();

            Assert.AreEqual(response.Code, 200);
            Assert.AreEqual(response.Status, true);
            Assert.AreEqual(response.Results[0].StatusMessage, "Updated Subscriber.");
        }
예제 #3
0
        public bool Resubscribe(string email, int[] lists = null)
        {
            var patchUser = new ETSubscriber
            {
                AuthStub      = SFClient,
                SubscriberKey = email,
                Lists         = GenerateSubscriberList(lists)
            };

            //Resubscribe to everything if no lists specified
            if (lists == null)
            {
                patchUser.Status = SubscriberStatus.Active;
            }

            var response = patchUser.Patch();

            return(response.Status);
        }