How to get the value of the variable obtained by JS in the body of the Recurring delivery.

Avatar

Avatar

uz2020

Avatar

uz2020

uz2020

20-01-2021

Hello.

 

I want to know, How to get the value of the variable obtained by JS in the body of the Recurring delivery.

For example, get the date. It into the Email body.

Email is a Text Email.

It is not a HTML Email.

 

JS

instance.vars.yearTest = formatDate (new Date(), "%Y")

logInfoz("yearTest = [" + instance.vars.yearTest + "]");

 

Recurring delivery

<%= $(instance/vars/@yearTest) &>

 

This will give an XFR-180000 error.

I don't think I understand correctly...

 

Thanks.

View Entire Topic

Avatar

Avatar

ParthaSarathy

Avatar

ParthaSarathy

ParthaSarathy

20-01-2021

Hi @uz2020 ,

Step 1: Right click recurring delivery > open > in script tab add this below code

delivery.variables._var[0].stringValue=instance.vars.yearTest;

script tab.PNG

 

Step 2: In delivery property 'Variable' tab, Add > Define Name and dataType alone 

(for eg, Name = yearTest and Data type = Text) and save the delivery.

variable tab.PNG

Step 3: Go to your text content tab, you can select your variable as shown below,

Text content.PNG 

 

Regards,

ParthaSarathy S