sendgridsendgrid-templates

sendgrid how to render array item dynamic templates


how to render array item:

How to render first 2 array items in 1 column and next 2 in next column

2 issues:

1.how to render array item:

data:

companies: ["company1", " company2", "company3", "company 4"]

html:

<li>{{ companies.[1]}} not working.

2.How to render first 2 array items in 1 column and next 2 in next column

companies: ["company1", " company2", "company3", "company 4"]

flexBox not working for gmail client :(


Solution

  • TEST DATA:

    {"companies": ["company1", " company2", "company3", "company 4"]}
    

    HTML:

    {{companies.[0]}}{{companies.[1]}}
    

    Resulting HTML with test data: company1 company2