2

I'm building an email that pulls from 22 different RSS feeds.

As I understand it, those 22 feeds will be static and un-changing. Each one of those 22 feeds will be pulled into its own content block (22 different content blocks), and, each one of those content blocks will be styled differently.

What's the best, most efficient way to accomplish this?

Can I manually store the content of those feeds inside of a Data Extension? Is it possible to somehow read the contents of a feed and store the contents in a data extension? Is this an advisable way to proceed?

  • Before I answer, if you put the contents of the feed in a DE, how would your email know how to do the lookup? – Timothy Sep 9 '14 at 18:53
  • I don't know! I'm thinking that this might be a possible solution? – Eric Sep 9 '14 at 19:09
  • In the data extension, there'd have to be some sort of field containing an ID, or some sort of marker. The AMPScript inside of each content block in the email would need to iterate through the data extension, looking for that marker. – Eric Sep 9 '14 at 19:10
0

I would do it something like this in EACH content area.

%%[
      VAR @var1, @var2, @var3  /*etc.*/

      SET @var1 = LOOKUP(/*Done based on primary key*/)

      IF(ISNULL(@var1)) THEN
           SET @var1 = BuildRowSetFromXML(HTTPGET(/*feed goes here*/))
           INSERTDE(/*put rowset in DE*/)
      ENDIF
           /*iterate over the rowset and set variables in email*/
]%%
MAIN EMAIL HERE.

Good luck

0

We did something similar to @Timothy:

%%[Var @xml, @xml1, @titles, @title, @descs, @desc, @links, @link, @cnt
Set @xml1 = ContentAreaByName("my contents\Blog_Feed")
Set @xml = Replace(@xml1,'content:encoded','contentencoded')
Set @titles = BuildRowsetFromXML(@xml,"//item/title",1)
Set @descs = BuildRowsetFromXML(@xml,"//item/description",1)
Set @links = BuildRowsetFromXML(@xml,"//item/link",1)
Set @rootdescs = BuildRowsetFromXML(@xml,"//root/description",1)
Set @roottitles = BuildRowsetFromXML(@xml,"//root/title",1)
Set @images = BuildRowsetFromXML(@xml,"//image/description",1)

//If RowCount(@titles) > 5 THEN
//SET @rows = 5
//ELSE
SET @rows = RowCount(@titles)
//ENDIF
]%%

EACH CONTENT AREA
%%[
IF @rows >= 1 THEN
for @cnt = 1 to @rows do
Set @title = Field(Row(@titles,@cnt),"Value")
Set @desc = Field(Row(@descs,@cnt), "Value")
Set @link = Field(Row(@links,@cnt), "Value") ]%%

a href="%%=RedirectTo(@link)=%%" alias="%%=v(@title)="%%" title="%%=v(@title)=%% style="color: #000;">%%=v(@title)=%%
span style="font: normal normal 0.76em Arial, Helvetica, sans-serif; color: #444;">%%=v(@desc)=%%


%%[ 
NEXT @cnt 
ENDIF
]%%

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.