Can not approve email due to velocity script (problem?)
Take the following code
#set($nrOfLinksInOutput = 1)
#if($nrOfLinksInOutput.equals(0))
#throw_v3("ineligible")
#else
#set($output = 'Links available')
#end
This above works, and the email can be approved in the cases where
$nrOfLinksInOutput = 1 & $nrOfLinksInOutput = 0 ( the throw case )
Of course this is a test case, the reality relies on the length of an array
So this is the ‘real’ code
#set($usedURLArray = [] )
Some processing that can add items to the array
and then:
#set($usedURLArrayLength = $usedURLArray.size() )
#if($usedURLArrayLength.equals(0))
#throw_v3("ineligible")
#else
##set($output = 'Links available')
#end
This code doesn’t succeed, and I am not able to approve my email.
Someone who can tell me what the problem could be?