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
Hi @Suchet-Randhawa,
Please check if this variables are checked in script-accessible objects.
Thanks,
Disha
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