Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Content Blocks / Javascript in Adobe Campaign Standard

New Here ,
Sep 06, 2021 Sep 06, 2021

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?

Views

1.1K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Sep 08, 2021 Sep 08, 2021

Kindly refer to help & support options for Campaign Standard.

Hope this helps!

Votes

Translate
Adobe Employee ,
Sep 08, 2021 Sep 08, 2021

Copy link to clipboard

Copied

Kindly refer to help & support options for Campaign Standard.

Hope this helps!

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

LATEST

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!

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines