*/Retrieving Subscriber Status from Publication list */
%%[
/* SET @EmailAddress = RequestParameter(“eml”) */
SET @EmailAddress = ‘abcd@theoreminc.net’
SET @Listint=’xxxxx’;
SET @rr = CreateObject(“RetrieveRequest”)
SetObjectProperty(@rr, “ObjectType”, “ListSubscriber”)
AddObjectArrayItem(@rr, “Properties”, “ListID”)
AddObjectArrayItem(@rr, “Properties”, “SubscriberKey”)
AddObjectArrayItem(@rr, “Properties”, “Status”)
SET @sfp1 = CreateObject(“SimpleFilterPart”)
SetObjectProperty(@sfp1,”Property”,”ListID”)
SetObjectProperty(@sfp1,”SimpleOperator”,”Equals”)
AddObjectArrayItem(@sfp1,”Value”,@Listint) // pass list Id
SET @sfp2 = CreateObject(“SimpleFilterPart”)
SetObjectProperty(@sfp2,”Property”,”SubscriberKey”)
SetObjectProperty(@sfp2,”SimpleOperator”,”Like”)
AddObjectArrayItem(@sfp2,”Value”,@EmailAddress) // pass EmailAddress
Set @cf1 = CreateObject(“ComplexFilterPart”)
SetObjectProperty(@cf1,”LeftOperand”,@sfp1)
SetObjectProperty(@cf1,”RightOperand”,@sfp2)
SetObjectProperty(@cf1,”LogicalOperator”,”AND”)
SetObjectProperty(@rr,”Filter”,@cf1)
SET @rows1 = InvokeRetrieve(@rr, @null, null)
If RowCount(@rows1) > 0 Then
SET @Status = Field(row(@rows1,1),”Status”)
EndIf
if @Status=’Active’ Then
SET @substatus = ‘checked’
ELSE
SET @unsubstatus = ‘checked’
]%%
Leave a comment