N
Novuβ€’3mo ago
jn

Images don't work properly in the Repeat component

I am self-hosting Novu v2.3.0. I cannot get images to work properly in the Repeat component of the email editor. Displaying the fields in an array as text work fine but images don't. In the attached images you can see the image displayed is always the one defined in the first json object in the lines array. Whereas the code is displayed correctly, i.e code1 and code2. The attached images show the output I am getting and the template placeholder strings I am using. I have also tried using the 'current' placeholder strings suggested within the app and everything else I could think of but those doesn't work at all. I followed the documentation here: https://docs.novu.co/platform/integrations/email/writing-email-template Any ideas? Using this json payload:
{
"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": {}
}
{
"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": {}
}
Writing Email Template | Novu Documentation
Learn how to build email templates in Novu using the block editor, the code editor (custom HTML), or the API
No description
No description
No description
12 Replies
Tomer Barnea
Tomer Barneaβ€’3mo ago
@jn are you using {{}} in the image link section? (just to confirm)
jn
jnOPβ€’3mo ago
Hi Tomer. Yes and I have tried every possible combination I could think of. In the screenshot below I typed the field using the {{}} brackets and then selected the suggested variable but I've tried everything.
jn
jnOPβ€’3mo ago
No description
jn
jnOPβ€’2mo ago
Has anybody else had a chance to try this? It just feels broken and no matter what I do I cannot get it work.
Tomer Barnea
Tomer Barneaβ€’2mo ago
Hi πŸ‘‹, yes seems to be some kind of bug we introduced recently as part of the work done there. Apologies, we are looking to do another round of polish on the email editor as a whole, so please add any feedback you have so we can incorporate that into the polish work. Cc @Pawan Jain
Pawan Jain
Pawan Jainβ€’2mo ago
@jn I just checked on our cloud, it is working as expected
jn
jnOPβ€’2mo ago
Hi @Pawan Jain Thanks for looking. It seems like the example you have shown is just repeating the same image multiple times. The issue I am having is that if you used a different image in the second json object of the array it will still display the first image multiple times. @Tomer Barnea Thanks for the response. Do you know roughly when these fixes will be integrated into a release that we can use self-hosted?
Tomer Barnea
Tomer Barneaβ€’2mo ago
Hi @jn can't say, but usually we deploy them once or twice a month, @Pawan Jain can you check that and update here?
jn
jnOPβ€’3w ago
@Pawan Jain Did you guys get a chance to check this with different images in a loop? It's blocking our abillity to move to Novu V2 if repeating images in emails don't work.
Novu_Bot
Novu_Botβ€’3w ago
@jn, you just advanced to level 2!
jn
jnOPβ€’3w ago
I've raised a github issue for this https://github.com/novuhq/novu/issues/9140
GitHub
πŸ› Bug Report: Images inside /repeat in the template editor repea...
πŸ“œ 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...
Pawan Jain
Pawan Jainβ€’3w ago
thanks @jn Will check this internally

Did you find this page helpful?