Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- .amp {
- font-size:1px;
- color:#fff;
- display: table-cell;
- }
- </style>
- <span class="amp">%%[</span>
- <style>
- .code_none{
- display:none;
- }
- </style>
- <table border="0" cellpadding="0" cellspacing="0" width="600" align="center" class="db-container block-bg">
- <tr>
- <td>
- <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" class="db-wrapper-padding block-bg">
- <tr>
- <td width="100%" class="db-full-width text-body text-align-center border-bottom p20top"><span class="p20bottom" style="display: block;">Products we think you'll enjoy...</span></td>
- </tr>
- </table>
- <table border="0" cellpadding="0" cellspacing="0" width="100%" class="db-wrapper-padding">
- <tr>
- <td width="33%" class="db-full-width text-body p25top p10right p25left">
- <br>
- <div class="p5bottom"><span class="font18"><b>Product Name</b></span></div>
- This is the coolest product you will ever use.
- <table width="100%" class="db-full-width">
- <tr>
- <td class="p5top"><span class="text-button-color font18"><b>$45</b></span></td>
- </tr>
- </table>
- </td>
- <td width="33%" class="db-full-width text-body p25top p10right p10left">
- <br>
- <div class="p5bottom"><span class="font18"><b>Product Name</b></span></div>
- This is the coolest product you will ever use.
- <table width="100%" class="db-full-width">
- <tr>
- <td class="p5top"><span class="text-button-color font18"><b>$45</b></span></td>
- </tr>
- </table>
- </td>
- <td width="33%" class="db-full-width text-body p25top p25right p10left">
- <br>
- <div class="p5bottom"><span class="font18"><b>Product Name</b></span></div>
- This is the coolest product you will ever use.
- <table width="100%" class="db-full-width">
- <tr>
- <td class="p5top"><span class="text-button-color font18"><b>$45</b></span></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table border="0" cellpadding="0" cellspacing="0" width="100%" class="db-wrapper-padding">
- <tr>
- <td class="db-full-width-padding-bottom text-body text-align-center p15top p20bottom">
- <table width="100%" class="db-full-width">
- <tr>
- <td class="text-align-center"><a href="" target="_blank" class="button-link button-link_button-color">Shop Now</a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <span class="amp">]%%</span>
- <div class="code_none">
- %%[ /* Generate three random numbers within the contraints of the DE */ var @rowCount, @high, @halfX, @half, @first, @second, @third set @rowCount = DataExtensionRowCount('NTO Products for Smart Blocks') set @halfX = Divide(@rowCount,2) /* Since @halfX can be a decimal we need to round up */ set @half = FormatNumber(@halfX,'N0') set @first = Random(1,Subtract(@half,1)) set @second = Random(Add(@half,1),@rowCount) set @third = Random(Add(@first,1),Subtract(@second,1)) /* Retrieve each matching row and assign variables */ var @rowset1, @row1, @product1name, @product1desc, @product1price, @product1image set @rowset1 = LookupRows('NTO Products for Smart Blocks','id',@first) set @row1 = Row(@rowset1,1) set @product1name = Field(@row1,'name') set @product1desc = Field(@row1,'description') set @product1price = Field(@row1,'price') set @product1image = Field(@row1,'imageUrl') var @rowset2, @row2, @product2name, @product2desc, @product2price, @product2image set @rowset2 = LookupRows('NTO Products for Smart Blocks','id',@second) set @row2 = Row(@rowset2,1) set @product2name = Field(@row2,'name') set @product2desc = Field(@row2,'description') set @product2price = Field(@row2,'price') set @product2image = Field(@row2,'imageUrl') var @rowset3, @row3, @product3name, @product3desc, @product3price, @product3image set @rowset3 = LookupRows('NTO Products for Smart Blocks','id',@third) set @row3 = Row(@rowset3,1) set @product3name = Field(@row3,'name') set @product3desc = Field(@row3,'description') set @product3price = Field(@row3,'price') set @product3image = Field(@row3,'imageUrl') ]%%<table border="0" cellpadding="0" cellspacing="0" width="600" align="center" class="db-container block-bg"><tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" class="db-wrapper-padding block-bg"><tr><td width="100%" class="db-full-width text-body text-align-center border-bottom p20top"><span class="p20bottom" style="display: block;">Products we think you'll enjoy...</span></td></tr></table><table border="0" cellpadding="0" cellspacing="0" width="100%" class="db-wrapper-padding"><tr><td width="33%" class="db-full-width text-body p25top p10right p25left"> <img src="%%= v(@product1image) =%%" width="100%" height="170" class="db-photo" style="display: block; object-fit: cover;"><br><div class="p5bottom"><span class="font18"><b>%%= v(@product1name) =%%</b></span></div> %%= v(@product1desc) =%%<table width="100%" class="db-full-width"><tr><td class="p5top"><span class="text-button-color font18"><b>$%%= v(@product1price) =%%</b></span></td></tr></table></td><td width="33%" class="db-full-width text-body p25top p10right p25left"> <img src="%%= v(@product2image) =%%" width="100%" height="170" class="db-photo" style="display: block; object-fit: cover;"><br><div class="p5bottom"><span class="font18"><b>%%= v(@product2name) =%%</b></span></div> %%= v(@product2desc) =%%<table width="100%" class="db-full-width"><tr><td class="p5top"><span class="text-button-color font18"><b>$%%= v(@product2price) =%%</b></span></td></tr></table></td><td width="33%" class="db-full-width text-body p25top p10right p25left"> <img src="%%= v(@product3image) =%%" width="100%" height="170" class="db-photo" style="display: block; object-fit: cover;"><br><div class="p5bottom"> <span class="font18"><b>%%= v(@product3name) =%%</b></span></div> %%= v(@product3desc) =%%<table width="100%" class="db-full-width"><tr><td class="p5top"> <span class="text-button-color font18"><b>$%%= v(@product3price) =%%</b></span></td></tr></table></td></tr></table><table border="0" cellpadding="0" cellspacing="0" width="100%" class="db-wrapper-padding"><tr><td class="db-full-width-padding-bottom text-body text-align-center p15top p20bottom"><table width="100%" class="db-full-width"><tr><td><a href="" target="_blank" class="button-link button-link_button-color">Shop Now</a></td></tr></table></td></tr></table></td></tr></table>
- </div>
Add Comment
Please, Sign In to add comment