N
Novu2mo ago
son

Add image to inapp notification message

Hi all how can i add image in template for in app notification basically i want to add user image every time notification is sent the image url will come form api call I tried some thing like below but it didnt worked <img src="{{imageUrl}}" alt="Product Image" width="300" />
11 Replies
Pawan Jain
Pawan Jain2mo ago
@son Are you using @novu/react package?
son
sonOP2mo ago
i am trying to create n eusing temaplete
son
sonOP2mo ago
No description
son
sonOP2mo ago
this section i want every message to have user image I have url image url not not sure how to configure img tag or can i have custom url in avatar?
Pawan Jain
Pawan Jain2mo ago
@son we don’t support custom user avatar in in-app editor
son
sonOP2mo ago
ok is there a way i can send notification to user and show image in notification like in faceboon comeone sends you notification it shoes person image and messge
Novu_Bot
Novu_Bot2mo ago
@son, you just advanced to level 1!
son
sonOP2mo ago
any update
Pawan Jain
Pawan Jain2mo ago
@son Use these steps to show user's avatar in in-app messages 1. create subscriber1 in novu and set the avatar field of this subscriber as a valid image url 2. create subscriber2 in novu 3. create the workflow, add in-app step and choose user avatar option. 4. trigger the workflow with in-app step to subscriber2 having subscriber1 as actor
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>', {
to: {
subscriberId: 'subscriber_id_2',
},
payload: {
"key": "value"
},
actor: "subscriber_id_1"
});
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>', {
to: {
subscriberId: 'subscriber_id_2',
},
payload: {
"key": "value"
},
actor: "subscriber_id_1"
});
@son Following up on this
son
sonOP2mo ago
hi
Pawan Jain
Pawan Jain2mo ago
@son Let me know if you need help

Did you find this page helpful?