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); }
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."); }
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); }