I have a nested array that I am passing as templateVar.
setTemplateVars(['details' => $arr]) The array($arr) is
[0] => [ ["key1"]=>value1 ["key2]=>value2 ] [1]=>[ ["key1"]=>value1 ["key2]=>value2 ] . . . All arrays have same keys. I have tried both updates mentioned in How to show array in email template file?
In the template file, I'm trying to use it as -
<?php foreach($details as $detail) : ?> <p>{{trans ' %val' val=$detail.key1}}</p> <?php endforeach; ?> I cannot pass it as a string as the array can be an array of 100s of arrays with same keys.