0
  var lists = List.Retrieve();
  //loop all lists, i starts at 1 or it will return all subscribers
  for (var i=1; i<lists.length; i++){

    if (lists[i].Type == "Public"){
      var listName = lists[i].ListName;
      var list = List.Init(lists[i].ListName);
      var subbed = Request.GetFormField(listName);

      if (unsubAll == "true"){
        var status = list.Subscribers.Add(email,{SubscriberKey:subkey});
        var status = list.Subscribers.Unsubscribe({EmailAddress:email, SubscriberKey:subkey});

      } else {
        if (subbed == "true") {
          var status = list.Subscribers.Add(email,{SubscriberKey:subkey});
          var status = list.Subscribers.Update(email, "Active");
          Write("Your subscription preference for " + email + " to " + listName + " has been updated to Active.");  
        }
      }
    }
  }

I am currently using this working code in our demo instance to add and remove subscribers from publication lists. I moved the code to our client's unit and the script runs, but it never actually updates the publication list by adding the subscriber's information. And ideas on what permission could be causing this error? I've already checked their API permissions for my user account and they are enabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.