AMPscript
Add
Remove
Retrieve
Subscribers.Add
Subscribers.Retrieve
Subscribers.Tracking.Retrieve
Subscribers.Unsubscribe
Subscribers.Update
Subscribers.Upsert
Validate Your Server-Side JavaScript using WSProxy
Adds any subscriber not on the specified list and updates any specified attributes
Subscribers.Upsert(1, 2)
| Ordinal | Type | Description | |
|---|---|---|---|
| 1 | string | Required | Attribute containing Email address of subscriber or a JSON object containing the EmailAddress and SubscriberKey values for the subscriber |
| 2 | string | Required | Any additional attributes regarding the subscriber. If the Status attribute exists in the passed attributes, it updates the subscriber status |
This sample code adds the specified values to the subscriber.
1var myList = List.Init("myList");
2var status = myList.Subscribers.Upsert("aruiz@example.com",{ZipCode:"46202"});