1

Here's my code. @email always comes up blank.

%%[
var @post_id, @url, @xml, @email, @query_vars, @query_vars2
set @post_id = Lookup("post_id","post_id","id",1)
@email = [Email Address]
@query_vars = Concat(@email,"&id=")
@query_vars2 = Concat(@query_vars, @post_id)
set @url = Concat("https://autoconnect.aaa.biz/feed?cat_user_email=", @query_vars2)
set @xml =  HTTPGet(v(@url))

Set @titles = BuildRowsetFromXML(@xml,"//item/title",1)
Set @descs = BuildRowsetFromXML(@xml,"//item/description",1)
Set @pubdas = BuildRowsetFromXML(@xml,"//item/pubDate",1)
Set @links = BuildRowsetFromXML(@xml,"//item/link",1)
SET @rowCount = 1

    for @i = 1 to @rowCount do

    IF RowCount(@titles) < 1 THEN
        RaiseError(@url, true)
    ENDIF

        Set @pubda = Field(Row(@pubdas,@i), "Value")

            Set @title = Field(Row(@titles,@i),"Value")
            Set @desc = Field(Row(@descs,@i), "Value")
            Set @link = Field(Row(@links,@i), "Value") 
            Set @pubda = Field(Row(@pubdas,@i), "Value") 
]%%
            <h1 style="Margin-top: 0;font-weight: normal;color: #447294;font-family: Georgia,serif;font-size: 26px;Margin-bottom: 12px;line-height: 36px">%%=v(@title)=%%</h1><p style="Margin-top: 0;font-weight: normal;color: #808285;font-family: sans-serif;font-size: 14px;Margin-bottom: 20px;line-height: 22px">%%=v(@desc)=%%...<a style="color: #4293b2;text-decoration: underline" data-emb-href-display="@%%=v(@link)=%%?utm_source=AutoConnect&utm_medium=email&utm_campaign=Alerts" href="%%=v(@link)=%%?utm_source=AutoConnect&utm_medium=email&utm_campaign=Weekly%20Digest" target="_blank">Read More</a></p>
%%[ 
    next @i  
]%%
3

See comments in the code below:

%%[
var @post_id, @url, @xml, @email, @query_vars, @query_vars2

set @post_id = Lookup("post_id","post_id","id",1)

/* missing 'set' on the next 3 lines */
/* your sending list or DE must include the Email Address attribute/column */
set @email = [Email Address]

/* don't need these (see below) */
/* set @query_vars = Concat(@email,"&id=") */
/* set @query_vars2 = Concat(@query_vars, @post_id) */

/* you can concat as many strings together as you need*/
set @url = Concat("https://autoconnect.aaa.biz/feed?cat_user_email=", @email,"&id=",@post_id)

/* don't need the v() function on this */
/* set @xml =  HTTPGet(v(@url)) */
set @xml =  HTTPGet(@url)

Set @titles = BuildRowsetFromXML(@xml,"//item/title",1)
Set @descs = BuildRowsetFromXML(@xml,"//item/description",1)
Set @pubdas = BuildRowsetFromXML(@xml,"//item/pubDate",1)
Set @links = BuildRowsetFromXML(@xml,"//item/link",1)

/* not sure what this is accomplishing: */
/* SET @rowCount = 1 */

/* seems like it should be this: */
Set @rowCount = rowcount(@titles)

/* this should be outside of your for loop */
IF @rowCount < 1 THEN
    RaiseError(@url, true)
endif

for @i = 1 to @rowCount do
    Set @pubda = Field(Row(@pubdas,@i), "Value")
    Set @title = Field(Row(@titles,@i),"Value")
    Set @desc = Field(Row(@descs,@i), "Value")
    Set @link = Field(Row(@links,@i), "Value") 
    Set @pubda = Field(Row(@pubdas,@i), "Value") 
]%%
    <h1 style="Margin-top: 0;font-weight: normal;color: #447294;font-family: Georgia,serif;font-size: 26px;Margin-bottom: 12px;line-height: 36px">%%=v(@title)=%%</h1>
    <p style="Margin-top: 0;font-weight: normal;color: #808285;font-family: sans-serif;font-size: 14px;Margin-bottom: 20px;line-height: 22px">%%=v(@desc)=%%...
       <a style="color: #4293b2;text-decoration: underline" data-emb-href-display="@%%=v(@link)=%%?utm_source=AutoConnect&utm_medium=email&utm_campaign=Alerts" href="%%=v(@link)=%%?utm_source=AutoConnect&utm_medium=email&utm_campaign=Weekly%20Digest" target="_blank">Read More</a>
    </p>
%%[ 
next @i  
]%%
|improve this answer|||||
  • Wow, there was a lot wrong with that! Thanks so much. I've been trying to get this for days! – Zack May 11 '15 at 12:32

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.