Been trying to figure out a way to pass in the variable into a
HTTPGet
function for long time now. How to do it? Here’s what I have so far, but it doesn’t return anything.<p id="date" style="font-family:Georgia, serif; color:#446c5a; font-style:italic; font-size:16px; padding-top:0px; margin-bottom:0;">%%xtmonth%% %%xtday%%, %%xtyear%%</p> %%[Var @curdate, @url SET @curdate = Format(Now(), "MMddyyyy") SET @url = Concat("http://theurltograbdatafrom.com/index.php?d=", @curdate) HTTPGet(@url) ]%% <p>%%=v(@url)=%%</p>
Have also tried the following:
<p id="date" style="font-family:Georgia, serif; color:#446c5a; font-style:italic; font-size:16px; padding-top:0px; margin-bottom:0;">%%xtmonth%% %%xtday%%, %%xtyear%%</p> %%[Var @curdate, @url SET @curdate = Format(Now(), "MMddyyyy") SET @url = Concat("http://theurltograbdatafrom.com/index.php?d=", @curdate) httpget; @url ]%% <p>%%=v(@url)=%%</p>
Both examples return absolutely nothing! However the return value in
<p>%%=v(@url)=%%</p>
returns the proper URL, but how to use this url in either of these ways??I am putting this code in a
Content Area
and than calling it from within an email that has that content retrieved into it.
Answer
Here ya go for everyone needing to know this. Here’s how it is done:
<p id="date" style="font-family:Georgia, serif; color:#446c5a; font-style:italic; font-size:16px; padding-top:0px; margin-bottom:0;">%%xtmonth%% %%xtday%%, %%xtyear%%</p>
%%[Var @curdate, @url
SET @curdate = Format(Now(), "MMddyyyy")
SET @url = Concat("http://theurltograbdatafrom.com/index.php?d=", @curdate) ]%%
%%=HTTPGet(v(@url))=%%
Many Thanks go to drakored for the syntax help on this!
Attribution
Source : Link , Question Author : Solomon Closson , Answer Author : Solomon Closson