Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Velocity email template with String list #2598

nmanos ·
Hi,
I'm trying to add to the velocity email template a for loop to print part of a String List, in this manner:

#set( $shelveFiles = 'file1_file2_file3_file4_file5_file6' )
#set( $shelveFileList = $shelveFiles.split('_') )
#set( $maxFiles = 3 )
#set( $countFiles = 0 )

#foreach ($element in $shelveFileList)
#if ($countFiles lt $maxFiles)
#break
#end
#set( $countFiles = $countFiles + 1 )
$element
#end


But Email output is printing #break as if it's not recognized:

#break file1 #break file2 #break file3 file4 file5 file6


Is it due to velocity version ?
How should I create and iterate on array that was created from String.split() ?

Thanks,
Noam.
  • replies 2
  • views 2319
  • stars 0
robinshen ADMIN ·
Yes, QB velocity 1.5 and seems that #break is only supported since 1.6. Please file an improvement request for this at track.pmease.com
nmanos ·
http://track.pmease.com/browse/QB-1856

Thanks!
Noam.