Skip to main content
Kenway_Du
Level 2
July 23, 2019
已解决

Velocity Token URL Parameter, Tracked but Not Rendering

  • July 23, 2019
  • 7回复
  • 4279查看

Hello, 

I'm trying to create an email that links to a survey, and that link needs to have a province parameter that is displayed via a velocity script that fetches the information from a custom object. 

Basic example:

Fill out this survey

"this survey" would be hyperlinked to "https://www.survey.com?prov=Ontario"

The "Ontario" value represents the province of a clinic they recently had an appointment with, and would use the clinic ID to fetch the province via velocity script from a custom object. 

The issue is that we need this link to be trackable, and I read in other posts that in order to have it trackable, I'd need to output the entire <a> tag from the velocity token itself. So I've tried:

Name of script token: {{my.SurveyLink}}

#set($CID = ${lead.recentDischargeClinicID})
##if clinic id found
#if($clinics.Map.get($CID))
<a href="https://www.survey.com/?prov=$clinics.Map.get($CID).PROV">this survey</a>
#end

In my email, I have:

<p>Fill out {{my.SurveyLink}}</p>

I sent a live email to myself to test it. The good news is it tracks the click.. The bad news is the parameter token doesn't render (i.e. the URL becomes "https://www.survey.com/?prov=$clinics.Map.get($CID).PROV")

Would anyone be able to point out what I could change to have the token render properly and also have the link be trackable?

Thanks

Kenway

此主题已关闭回复。
最佳答案由 SanfordWhiteman

Try

<a href="https://www.survey.com/?prov=${clinics.Map.get($CID).PROV}">this survey</a>

7回复

SanfordWhiteman
Level 10
July 23, 2019

Please highlight your code using the Advanced Editor's syntax highlighter so it's readable.

Then we'll continue.

Kenway_Du
Kenway_Du作者
Level 2
July 24, 2019

Sorry @Sanford Whiteman‌, would you please direct me to where I'd find the Advanced Editor? I've never used it. 

SanfordWhiteman
Level 10
July 24, 2019

Right here:

And then follow this steps from this prerecorded GIF: