We've written a custom token to pull a piece of custom data off of any open cases. The token works as an imploded variable. I'd like to be able to use the token as an array as well (so I can run a for each loop in an email communication.) I am having trouble accessing the array.
If I use the variable {extrainfo.namearray} the email prints "Array". I've tried a simple foreach loop
{foreach from=extrainfo.namearray item=value key=label}
<tr>
<td>{$label}</td>
<td>{$value}</td>
</tr>
{/foreach}
This prints out an "0" and "extrainfo.namearray" I can only assume that's becuase I don't have the "$" before the token name. The statement prints out nothing if I add the $ to the token name.
I know the array has content, if I use {debug} in an email, I can see that it is part of the {$contact} tokens. It prints our the array itself with the expected data:
extrainfo.namearray => Array (3)
97485 => "Name 1"
97486 => "Name 2"
97547 => "Name 3"
I also tried accessing it in this manner {$contact.extrainfo.namearray} but that prints nothing (not even "Array").
Any advice on how I can target/loop items in the {extrainfo.namearray} array?