Как получить доступ к конкретному элементу в массиве Mandrill? - PullRequest
0 голосов
/ 16 мая 2019

Я хотел бы получить доступ к определенному элементу в массиве в Mandrill.

"merge_vars": [
        {
            "rcpt": "someemail@gmail.com",
            "vars": [
                {
                    "name": "shoes",
                    "content": [
                        {
                            "id": 1026798092388,                               
                            "gender": "M",
                            "children": [
                                {
                                    "title": "BlackAndWhite",
                                    "sku": "",
                                    "id": 2252118491236,
                                    "atoms_status": "unfulfilled",
                                    "atoms_returned": false,
                                    "size": "9.5",
                                    "foot": "Left"
                                },
                                {
                                    "title": "BlackAndWhite",
                                    "sku": "",
                                    "id": 2252118524004,
                                    "atoms_status": "unfulfilled",
                                    "atoms_returned": false,
                                    "size": "9.5",
                                    "foot": "Right"
                                }
                            ]

Пробный доступ выглядит так:

{{#each shoes}} 

   {{this.title}}<br>
   {{ #if `this.children[0].size != this.children[1].size` }}
      {{#each this.children}}                       
            foot: {{this.foot}}<br>
            size: {{this.size}}<br>
      {{/each}} 
   {{ else }}                     
         size: {{this.size}}<br>
   {{/if}}
{{/each}}     

К сожалению, эта часть не работает:

{{ #if `this.children[0].size != this.children[1].size` }}
...