Dynamic Content Samples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
var @rows,@row,@key,@percent,@contentPath | |
set @key = _subscriberkey | |
set @rows = LookupRows("Common_Subscriber_View","SubscriberKey",@key) | |
if RowCount(@rows) == 1 then | |
set @row = Row(@rows,1) | |
set @percent = Field(@row,"Percentage_Complete") | |
else | |
set @percent = 25 | |
endif | |
IF @percent <= 25 THEN | |
set @contentPath = "WD2 - Hero - 25% Complete - 600" | |
ELSEIF @percent <= 50 THEN | |
set @contentPath = "WD2 - Hero - 50% Complete - 600" | |
ELSEIF @percent <= 75 THEN | |
set @contentPath = "WD2 - Hero - 75% Complete - 600" | |
ENDIF | |
]%% | |
%%=ContentAreaByName(@contentPath)=%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table width="520" border="0" cellspacing="0" cellpadding="0"> | |
<tr> | |
<td width="15" rowspan="7"></td> | |
<td width="185" rowspan="7" valign="top"> | |
<a href="%%=RedirectTo(@prodURL)=%%" alt="%%=v(@prodName)=%%" conversion="true" alias="%%=v(@prodName)=%%" class="product_link" id="%%=v(@prodSKU)=%%"><img src="%%=v(@prodThumb)=%%" width="185" height="185" alt="%%=v(@prodName)=%%" border="0" style="display:block;" /></a> | |
</td> | |
<td width="10" rowspan="7"></td> | |
<td valign="top" width="295" colspan="2 align="left" style="font-family:Helvetica, Arial, sans-serif;font-size:16px;font-weight:bold;color:#455560;"> | |
%%=v(@prodName)=%% | |
</td> | |
<td width="15" rowspan="7"></td> | |
</tr> | |
<tr> | |
<td valign="top" height="6" colspan="2"></td> | |
</tr> | |
<tr> | |
<td valign="top" align="left"> | |
<img src="%%=v(@starImage)=%%" width="69" height="17" alt="star rating" border="0" style="display:block;" /> | |
</td> | |
<td valign="middle" align="left" width="226" style="font-family:Helvetica, Arial, sans-serif;font-size:11px;font-weight:bold;color:#b2b7bb;"> | |
(%%=v(@ratingNum)=%%) | |
</td> | |
</tr> | |
<tr> | |
<td valign="top" height="10" colspan="2"></td> | |
</tr> | |
<tr> | |
<td valign="top" align="left" colspan="2" style="font-family:Helvetica, Arial, sans-serif;font-size:12px;color:#455560;"> | |
%%=v(@prodDesc)=%% | |
</td> | |
</tr> | |
<tr> | |
<td valign="top" height="15" colspan="2"></td> | |
</tr> | |
<tr> | |
<td valign="top" align="left" colspan="2"> | |
<a href="%%=RedirectTo(@prodURL)=%%" alt="%%=v(@prodName)=%%" conversion="true" alias="%%=v(@prodName)=%%" class="product_link" id="%%=v(@prodSKU)=%%"><img src="http://image.s4.exct.net/lib/fe901570726d037d72/m/1/learn-more-large.png" height="55" width="161" alt="Learn More" border="0" style="display:block;" /></a> | |
</td> | |
</tr> | |
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
var @abandSKU,@count,@rows,@row1,@rows1,@row2,@prodURL,@prodName,@prodThumb,@prodSKU,@prodDesc,@ratingAvg,@ratingNum,@starImage | |
]%% | |
<script type ="text/javascript" runat="server"> | |
Platform.Load("core","1"); | |
var allSKUs = Attribute.GetValue("SKU"); | |
var s = allSKUs.length; | |
var finalSKU; | |
if (s == "6") { | |
finalSKU = allSKUs; | |
} else { | |
var mySKUarray = allSKUs.split('|'); | |
finalSKU = mySKUarray[0]; | |
} | |
var setSKU = Variable.SetValue("ampSKU",finalSKU); | |
</script> | |
%%[ | |
/*Grab SKU from SSJS*/ | |
set @abandSKU = @ampSKU | |
/*Get Product Information*/ | |
set @rows = LookupRows("Products","SKU",@abandSKU) | |
set @row1 = Row(@rows,1) | |
set @prodURL = Field(@row1,"Product_URL") | |
set @prodName = Field(@row1,"Product_Name") | |
set @prodThumb = Field(@row1,"Thumbnail_URL") | |
set @prodSKU = Field(@row1,"SKU") | |
set @prodDesc = Field(@row1,"Product_Description") | |
/*Get Ratings Information*/ | |
set @rows1 = LookupRows("Product_Ratings","SKU",@abandSKU) | |
IF RowCount(@rows1) == 1 THEN | |
set @row2 = Row(@rows1,1) | |
set @ratingAvg = Field(@row2,"Average_Rating") | |
set @ratingNum = Field(@row2,"Number_of_Ratings") | |
/*If ratings do exist set the star image*/ | |
IF (@ratingAvg < 4) THEN | |
set @starImage = "http://image.s4.exct.net/lib/fe901570726d037d72/m/1/threeStarGRAY.jpg" | |
ELSEIF (@ratingAvg < 5) THEN | |
set @starImage = "http://image.s4.exct.net/lib/fe901570726d037d72/m/1/fourStarGRAY.jpg" | |
ELSE | |
set @starImage = "http://image.s4.exct.net/lib/fe901570726d037d72/m/1/fiveStarGRAY.jpg" | |
ENDIF | |
ELSE | |
/*If ratings don't exist set to no*/ | |
set @ratingAvg = "no" | |
set @ratingNum = "no" | |
ENDIF | |
]%% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment