How to Access javascript variable in Continuous delivery | Community
Skip to main content
December 27, 2017

How to Access javascript variable in Continuous delivery

  • December 27, 2017
  • 3 replies
  • 3173 views

Hi All,

          I want to read java script variable in the continuous delivery template. please help me.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

vraghav
Adobe Employee
Adobe Employee
December 28, 2017

Hi Prabhu,

We already have a thread which seems to cater to your requirement.

Can you please refer to Use of variable in continuous delivery, how to do ?

If you have a different requirement please elaborate more on it.

Regards,
Vipul

January 8, 2018

Hi Vipul,

              Thanks for sharing the details. I need one help for below scenario.

We are sending mail with coupon code on monthly basis. For each month separate coupon code and content.

For this, we wrote one personalization block and then we send a mail. But in this block, we faced one issue in email client template mirror link. If the customer opens previous month mirror link, it shows current month coupon code and content (View in Browser). But in email template client it is showing the right coupon code and content.

Personalization block JavaScript

  var currentDate = new Date();

var currentMonth = (currentDate.getMonth());

var json = {"1":["Seller1", "Seller2", "Seller3", "Seller4", "Seller5", "Seller6", "Seller7", "Seller8", "Seller9", "Seller1", "Seller1", "Seller1"]};

var seller=json[1][currentMonth];

if( seller== "Seller1") {

coupon code and content

}

elseif( seller== "Seller1")

{

coupon code and content

}

January 7, 2018

Hi Vipul,

              Thanks for sharing the details. I need one help for below scenario.

We are sending mail with coupon code on monthly basis. For each month separate coupon code and content.

For this, we wrote one personalization block and then we send a mail. But in this block, we faced one issue in email client template mirror link. If the customer opens previous month mirror link, it shows current month coupon code and content (View in Browser). But in email template client it is showing the right coupon code and content.

Personalization block JavaScript

  var currentDate = new Date();

var currentMonth = (currentDate.getMonth());

var json = {"1":["Seller1", "Seller2", "Seller3", "Seller4", "Seller5", "Seller6", "Seller7", "Seller8", "Seller9", "Seller1", "Seller1", "Seller1"]}; 

var seller=json[1][currentMonth]; 

if( seller== "Seller1") {

coupon code and content

}

elseif( seller== "Seller1")

{

coupon code and content

}

Gaurang-1
Level 9
July 26, 2018

Hi,

Were you able to find something relevant for your query here?

Gaurang