Velocity Script Token for Dynamic Content | Adobe Higher Education
Skip to main content
Level 1
October 19, 2022
질문

Velocity Script Token for Dynamic Content

  • October 19, 2022
  • 2 답변들
  • 1564 조회

Hi, I can't figure out why my email script is not working:

 

Here is the situation:

A lead fills out a form for our upcoming user conference and can choose a combination of sessions that they would like to attend. The lead then receives an email response with dynamic content based on the sessions that they chose.

 

#if (${lead.intelliconSession1} == "1") <p><strong> TEXT</strong></p> #end #if (${lead.intelliconSession2} == "1") <p><strong>TEXT </strong></p> #end #if (${lead.intelliconSession3} == "1") <p><strong>TEXT</strong></p> #end #if (${lead.intelliconSession4} == "1") <p><strong>TEXT/strong></p> #end #if (${lead.intelliconSession5} == "1") <p><strong>TEXT</strong></p> #end #if (${lead.intelliconSession6} == "1") <p><strong>TEXT</strong></p> #end

 

이 주제는 답변이 닫혔습니다.

2 답변

Disha_Goyal6
Community Advisor
Community Advisor
October 19, 2022

Hi @suchet-randhawa,

 

Please check if this variables are checked in script-accessible objects.

 

Thanks,

Disha

 

 

SanfordWhiteman
Level 10
October 19, 2022

Remember to use the syntax highlighter when posting code (I edited your post this time).

 

“Not working” isn’t really enough to go on. We’d need to know the expected outcome and what you observe, and you haven’t established that the values you’re matching on (strings "1" and "0") are the real values of your fields. Disha is of course correct that if the fields aren’t checked off in Script Editor, nothing will work.

 

Even before having that additional info, there are some standard syntax corrections to make here. You shouldn’t be using the double-equals operator, and formal notation isn’t necessary:

#if ($lead.intelliconSession1.equals("1")) <p><strong> TEXT</strong></p> #end #if ($lead.intelliconSession2.equals("1")) <p><strong>TEXT </strong></p> #end #if ($lead.intelliconSession3.equals("1")) <p><strong>TEXT</strong></p> #end #if ($lead.intelliconSession4.equals("1")) <p><strong>TEXT/strong></p> #end #if ($lead.intelliconSession5.equals("1")) <p><strong>TEXT</strong></p> #end #if ($lead.intelliconSession6.equals("1")) <p><strong>TEXT</strong></p> #end