Solved
Forum Discussion
ttadej
8 years agoAdvisor
Thanks DougS
We ended up doing this, which seems excessive but worked:
#set ($postUrl = $notification.message.webUi.url) #if ($postUrl.contains('#')) #set ($splitPostUrl = $postUrl.split('#')) #foreach ($part in $splitPostUrl) #if ($velocityCount == 1) #set ($urlPath = $part) #elseif($velocityCount == 2) #set ($urlHash = $part) #end #end <a href="$!{urlPath}?${utmTag}#$!{urlHash}"> #else <a href="${postUrl}?${utmTag}"> #end
This isn't much documentation here: https://velocity.apache.org/engine/1.5/user-guide.html#loops
Unfortunately $arr.get(index) does not seem to work even though Lithium is using Velocity v1.5
Inactive User
4 years agottadej Does your code work? I have tried it in one of our emails and it isn't working as I would expect. Did you change anything in it?
Related Content
- 2 years ago
- 2 years ago