Copy link to clipboard
Copied
Content Blocks / Javascript in Adobe Campaign Standard
I'm currently looking to implement Content blocks containing Javascript in several transactional emails. This is with the intention of replicating certain functionality across multiple transational emails for code re-use.
I have seen several topics where other users have tried using Javascript within content blocks to iterate through product lists but havnt found anything about obtaining specific information sent across in those product lists. This could be to select the name or price of a product during an iteration.
I understand product list iterations can quite easily be implemented through the editor, but there may be things that need implementing outside its scope.
To put my case in perspective, I have been using the following json to populate a two products within a listing.
{
"EVTabandonedBasketProductList": [
{
"EVTabandonedProductDecription": "Domaine Reverdy’s fine 2020 epitomises the elegant, complex and minerally character that has made Sancerre an enduring benchmark style for centuries.",
"EVTabandonedProductName": "Domaine Reverdy’s fine 2020",
"EVTabandonedProductPrice": 20,
"EVTabandonedProductSize": ".75l",
"EVTabandonedProductSku": "0475420"
},
{
"EVTabandonedProductDecription": "This exquisite Sancerre is from the Laportes’ small family domaine in Chavignol, long regarded as one of the appellation’s top crus.",
"EVTabandonedProductName": "Domaine Serge Laporte Sancerre 2020",
"EVTabandonedProductPrice": 21,
"EVTabandonedProductSize": ".75l",
"EVTabandonedProductSku": "2239520"
}]
}
I found out the EVTabandonBasketProductList is setup as EntityCollection Object which can it iterated through via a for and for each loop.
This is a simple snipet I used to iterate through the product list.
<%
for each (var entity in context.rtEvent.ctx.EVTabandonedBasketProductList) {
for each (var wpp in entity) {
document.write(wpp + '<br>')
}
document.write('<br><br>')
}
%>
Even though all the values display correctly within my tests, there seems no way of displaying or selecing a specfic value from the WppObject without an error occuring or the email not sending at all.
<%= wpp.name %> would show up 'undefined'
Am I going about this the wrong way?
1 Correct answer
Kindly refer to help & support options for Campaign Standard.
Hope this helps!
Copy link to clipboard
Copied
Kindly refer to help & support options for Campaign Standard.
Hope this helps!
Copy link to clipboard
Copied
Hi there,
You may also try posting your query in the following community: https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-standard/bd-p/adobe-campaign-standar...
Experts here will be able to assist you better. Thanks!

