1

I want to pull a subscriber's list of subscriptions into a re-engagement email sent via Marketing Cloud.

e.g.

Hi

You are subscribed to:

  1. xx
  2. xx
  3. xx

How do I pull this information through into the email dynamically using AmpScript?

Thanks

Josh

0

Probably your subscribers would be inside the _ListSubscribers where the different names of the Subscription Lists could be gotten via AMPScript LookUpRows.

For that you would do something like (not 100% sure):

var @var1, @rows, @subscriberlist, @rowcount
set @var1 = [DataExtensionField that is your subscriberkey / id / emailaddress]

set @rows = LookupRows('_ListSubscribers','SubscriberKey',v(@var1),'Status','active')
set @rowcount = rowcount(@rows)

if @rowcount > 0 then
    for @i = 1 to @rowcount do
        set @row = row(@rows,@i)
        set @subscriberlist = field(@row,"ListName")

        output(concat("<br>",v(@subscriberlist)))
    next @i
else
   ???
endif
  • 4
    I would not recommend doing a lookup against the _ListSubscribers data view in the email. It'd be much better to build a DE ahead of time and just do a simple lookup and loop in your email -- especially for a re-engagement campaign. – Adam Spriggs Sep 20 '18 at 11:38
  • Indeed querying against _ListSubscribers will take a lot of time. Therefore you should create an automation in automation studio with an sql query that lists every subscription of subscribers which has the status active. SubscriberKey/ID should be the unique value in that dataextension and you should insert all Lists in a second field. Or something similar like that. And then you would query this newly created dataextension with a lookup. But if you wanna do that you need to have atleast the pro version of marketing cloud, if you have the basic edition you wont have access to automations. – Johannes Schapdick Sep 20 '18 at 11:44
  • 1
    @JohannesSchapdick - you might want to update your answer for easier reference of other users instead of adding the details into a comment. – Gortonington Sep 20 '18 at 13:43

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.