I'm trying to fetch length of an array but it seems length only exists for conditionals.
Data:
{
"array": ["a", "b", "c"]
}
in sendgrid template:
{{array.length}}
and nothing is rendered in the email (preview renders it correctly).
Is there a workaround for this?
it looks like you can use the greaterThan
tag
Example from Sendgrid docs:
<p>
Hello Ben!
{{#greaterThan (length cartItems) 0}}
It looks like you still have some items in your shopping cart. Sign back in to continue checking out at any time.
{{else}}
Thanks for browsing our site. We hope you'll come back soon.
{{/greaterThan}}
</p>