N
Novu6mo ago
Drex

Hyper links (redirects) for in app notifications

if i have a notification such as a user's name and i want it such that when the name is clicked, it takes them to a page on my website, how do i implement that i want the redirect to happen not on the entire notification click but on just the name click
12 Replies
Drex
DrexOP6mo ago
@dr.really @Pawan Jain
dr.really
dr.really6mo ago
Can you post some sample code that you're using?
Drex
DrexOP6mo ago
No description
Drex
DrexOP6mo ago
@dr.really Or what sample code doo you mean because i thought the change would be on the Dashboard UI as that was where i created the notification template
dr.really
dr.really6mo ago
so the way we handled this at work is in the metadata that comes back from the inbox notification, there should be a subscriber object, in that you can then render your notification card to set up your hyperlink
Drex
DrexOP6mo ago
That works if i want to have a primary button or a secondary button or maybe i want the user to be redirected when they click on the notification itself but this case, the notification looks like this
Drex
DrexOP6mo ago
So if a user clicks on any of those underlined texts, it takes them to a different url
No description
Drex
DrexOP6mo ago
This is tthe template i created on the dashboard
No description
dr.really
dr.really6mo ago
so if you log out your notification, you should see the extra object keys that i'm talking about
Pawan Jain
Pawan Jain6mo ago
@Drex Try this Inbox content
We let <a href="{{payload.sender_name.redirect_url}}" target="_blank"> {{payload.sender_name}} </a> know that you are interesterd inm teaming up with them for .....rest of the content
We let <a href="{{payload.sender_name.redirect_url}}" target="_blank"> {{payload.sender_name}} </a> know that you are interesterd inm teaming up with them for .....rest of the content
make sure to enable above toggle Disable content sanitization then use <p dangerouslySetInnerHTML={{ __html: notification.body}}>
Drex
DrexOP6mo ago
Thank you @Pawan Jain this works
Novu_Bot
Novu_Bot6mo ago
@Drex, you just advanced to level 2!

Did you find this page helpful?