Email Script Token Shows Token as Text
I'm sure this is a simple solution but, being as new to Velocity as I am (very), I have no idea how to resolve it.
I created my script (below) and previewed the email. It results in nothing. If I create a standalone display of one of the in-script tokens, it results in the token as text. For example, having it display "$eventCount" results in the literal text of "$eventCount".
Am I missing something?
#set($originalLength = $lead.Field-1.length())
#set($replacedLength = $lead.Field-1.replace(";","").length())
#set($eventCount = $originalLength - $replacedLength)
#if($eventCount == 1) <p>You succesfully registered for a training class. If you are attending virtually, you will recieve the link to join via this email address the day before training begins. If you have any questions please reach out to Person at <a href="mailto:person@emailaddress.com" target="_blank"> person@emailaddress.com</a>.</p>
#else <p>You succesfully registered for $eventCount Trend Micro training classes. If you are attending virtually, you will recieve the links to join via this email address the day before training begins. If you have any questions please reach out to Person at <a href="mailto: person@emailaddress.com" target="_blank"> person@emailaddress.com</a>.</p>
#end
<ul>
#if ($lead.Field-1.matches(".*Product1.*")) <li><strong>Product 1 Certified Professional</strong> DATE<br /><a href="LINK.COM" target="_blank">Add to Calendar →</a></li> #end
#if ($lead.Field-1.matches(".*Product2.*")) <li><strong>Product 2 Certified Professional</strong> DATE<br /><a href="LINK.COM" target="_blank">Add to Calendar →</a></li> #end
#if ($lead.Field-1.matches(".*Product3.*")) <li><strong>Product 3 Certified Professional</strong> DATE<br /><a href="LINK.COM" target="_blank">Add to Calendar →</a></li> #end
</ul>