How to bind with handlebars the value of the object inside the array in Sendgrid❓

Options

Hello guys,

I'm less than a week old on Xano and managed to populate a dynamic template with sendgrid, except the "value" of "content" array. We're supposed to use handlebars but neither {{value}} nor {{content.value}} in the template work. Any tip appreciated!

Thanks for your attention.

Best Answer

  • Fredk
    Fredk Member
    edited February 2023 Answer ✓
    Options

    You know what guys, don't bother with such structure:

    "content": [
        {
          "type": "text/html",
          "value": "<p>Hello from Twilio SendGrid!</p><p>Sending with the email service trusted by developers and marketers for <strong>time-savings</strong>, <strong>scalability</strong>, and <strong>delivery expertise</strong>.</p><p>%open-track%</p>"
        }
      ],
    

    A suggestion on Stackoverflow works. Use triple curly brackets {{{value}}} in the template and a plain and simple "value" property in the dynamic template data object, and the html formatting will be rendered nicely, like: "value": "Hello there,<br>My second line"

    Although I'd still like to know how to handle the value of an object property inside in an array... If anyone knows...