AnsweredAssumed Answered

Hyperlink in Velocity Script Not Working

Question asked by Chrystal Martin on Jun 6, 2019
Latest reply on Jun 6, 2019 by Mark Price

I have the following token velocity script to insert a bulleted list of up to 4 hyperlinked recommended courses in our emails:

 

#set($url1 = ${lead.recCourse1PURL})
#set($url2 = ${lead.recCourse2PURL})
#set($url3 = ${lead.recCourse3PURL})
#set($url4 = ${lead.recCourse4PURL})

 

<ul style="padding-bottom:0px; margin-bottom:0px; font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size:18px; line-height:26px;">
<li><a style="color:#2774ae; text-decoration:none; font-weight:bold;" href="${url1}">${lead.recCourse1PTitle}</a></li>

#if( !$lead.recCourse2PTitle.isEmpty() )
<li><a style="color:#2774ae; text-decoration:none; font-weight:bold;" href="${url2}">${lead.recCourse2PTitle}</a></li>
#end
#if( !$lead.recCourse3PTitle.isEmpty() )
<li><a style="color:#2774ae; text-decoration:none; font-weight:bold;" href="${url3}">${lead.recCourse3PTitle}</a></li>
#end

#if( !$lead.recCourse4PTitle.isEmpty() )
<li><a style="color:#2774ae; text-decoration:none; font-weight:bold;" href="${url4}">${lead.recCourse4PTitle}</a></li>
#end
</ul>

 

It displays as hyperlinked unordered list based on custom fields on the lead, looking like:

  • Introduction to Management
  • Storytelling
  • Graphic Design
  • Principles of accounting

 

And it works...except the second bullet's hyperlink (recCourse2PURL) never works, even when tested with several different leads. The test email always sets that link as

<li>

<a style="color:#2774ae; text-decoration:none; font-weight:bold;" href="${lead.recCourse2PURL}">Storytelling</a>.

</li>

 

 

The URL is written correctly in the field, and I've tested multiple users. Whether they only have 1 recommended course, 2, 3, or 4, the second bullet's hyperlink never works. I've triple checked that Rec Course 2 P URL has been checked for the script. Can someone help me?

Outcomes