Skip to content

🐛 Bug Report: Images inside /repeat in the template editor repeat first image only #9140

@Coinio

Description

@Coinio

📜 Description

I am unable to get repeating images to work in the template editor. If I have an array of objects inside the payload with a different image in each object then the first image will be shown for each repeat instead of specified image for each object. Text fields work fine.

I have tried every possible combination of syntax, e.g. payload.lines.image, current.image, etc, and nothing works.

👟 Reproduction steps

1.) In the template editor, create a new workflow which has a /repeat component and inside the repeat:

  • Add a text field with the placeholder reference {{payload.lines.code}}
Image
  • An image with the placeholder {{payload.lines.preview}}.
Image

2.) Then test the workflow with this payload. Note that the first image is black and the second is orange.

{
"payload": {
"lines": [
{
"code": "code1",
"preview": "https://placehold.co/600x400/000000/FFF"
},
{
"code": "code2",
"preview": "https://placehold.co/600x400/orange/white"
}
],
"accountCode": "accountCode",
"customerReference": "customerReference",
"quoteNumber": "quoteNumber"
},
"subscriber": {
"subscriberId": "123456",
"firstName": "John",
"lastName": "Doe",
"email": "user@example.com",
"phone": "+1234567890",
"avatar": "https://example.com/avatar.png",
"locale": "en-US",
"data": {}
},
"steps": {}
}

👍 Expected behavior

It should render the the two different images, one black and one orange with the text fields.

👎 Actual Behavior with Screenshots

The text is rendered properly, i.e. code1 and code2 but the first image (black) is just repeated and the second image (orange) is ignored.

Image

Novu version

Novu Self Host docker image 2.3.0

npm version

Docker 2.3.0

node version

21.x

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions