Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference a single item in an array by position #91

Open
CastleandRook opened this issue Sep 23, 2021 · 0 comments
Open

Reference a single item in an array by position #91

CastleandRook opened this issue Sep 23, 2021 · 0 comments

Comments

@CastleandRook
Copy link

CastleandRook commented Sep 23, 2021

Actual Behaviour

Json
`curl -X "POST" "https://api.sendgrid.com/v3/mail/send"
-H 'Authorization: Bearer <<YOUR_API_KEY>>'
-H 'Content-Type: application/json'
-d '{
"from":{
"email":"[email protected]"
},
"personalizations":[
{
"to":[
{
"email":"[email protected]"
}
],
"dynamic_template_data":{

        "recently_viewed_products":[
           {
              "title":"Yellow A-line Gown by Teeze&nbsp;me",
              "image":"https://qny.queenly.com/wardrobe_grid/wardrobe-1631372397543.jpg",
              "link":"https://queenly.com/featured/night-out-dresses"
           },
           {
              "title":"Dress",
              "image":"https://marketing-image-production.s3.amazonaws.com/uploads/8dda1131320a6d978b515cc04ed479df259a458d5d45d58b6b381cae0bf9588113e80ef912f69e8c4cc1ef1a0297e8eefdb7b270064cc046b79a44e21b811802.png",
              "link":"URL"
           },
           {
              "title":"Dress",
              "image":"https://marketing-image-production.s3.amazonaws.com/uploads/8dda1131320a6d978b515cc04ed479df259a458d5d45d58b6b381cae0bf9588113e80ef912f69e8c4cc1ef1a0297e8eefdb7b270064cc046b79a44e21b811802.png",
              "link":"URL"
           },
           {
              "title":"Dress",
              "image":"https://marketing-image-production.s3.amazonaws.com/uploads/8dda1131320a6d978b515cc04ed479df259a458d5d45d58b6b381cae0bf9588113e80ef912f69e8c4cc1ef1a0297e8eefdb7b270064cc046b79a44e21b811802.png",
              "link":"URL"
           },
           {
              "title":"Dress",
              "image":"https://marketing-image-production.s3.amazonaws.com/uploads/8dda1131320a6d978b515cc04ed479df259a458d5d45d58b6b381cae0bf9588113e80ef912f69e8c4cc1ef1a0297e8eefdb7b270064cc046b79a44e21b811802.png",
              "link":"URL"
           },
           {
              "title":"Dress",
              "image":"https://marketing-image-production.s3.amazonaws.com/uploads/8dda1131320a6d978b515cc04ed479df259a458d5d45d58b6b381cae0bf9588113e80ef912f69e8c4cc1ef1a0297e8eefdb7b270064cc046b79a44e21b811802.png",
              "link":"URL"
           }

        ]
      }
  }

],
"template_id":"d-c954edc39559465ba86fefbe2a10f357"
}'`

I'd like to reference just one of the items in my email by its position. Was trying to use
<img src="{{recently_viewed_prooducts.[0].image}}" alt="" width="250" height="330" border="0" style="display: block; max-width: 250px;"/>

However nothing is showing up

Expected Behaviour

Expected the first product in the arrays immage to show

Steps to reproduce it

Add steps to reproduce bugs or add information on the place where the feature should be implemented. Add links to a sample deployment or code.

Would you like to work on the issue?

I would like someone to help me on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant