Eden
Eden
NNovu
Created by Eden on 9/3/2024 in #💬│support
Payload.data isn't passed to FE
Hey novu! i posted about a week ago about not being able to pass custom data from my action to the notification center, and after a great Pull-Reqeust from @Paweł T. and the help of @Pawan Jain i thought the issue was fixed with a new version, but after testing (with the code below) my issue seems to persist. Here's my simple setup:
await step.inApp(
'send-mention-notification',
async () => {

return {
body: jsonDocument,
subject: controls.subject ?? `${mentionedByName} mentioned you in a comment`,
data: {
url: getCommentUrl(comment.url ?? '', comment.id),
},
};
},
{
skip: async () => shouldSkipMentionWorkflow(payload),
},
);
},


<Inbox
applicationIdentifier={novuApplicationIdentifier}
subscriberId={userId}
appearance={appearance}
renderNotification={(notification) => {
console.log('Notification received', JSON.stringify(notification));
return (
<div>
<h3>{notification.subject}</h3>
<p>{notification.body}</p>
</div>
);
}}
/>
await step.inApp(
'send-mention-notification',
async () => {

return {
body: jsonDocument,
subject: controls.subject ?? `${mentionedByName} mentioned you in a comment`,
data: {
url: getCommentUrl(comment.url ?? '', comment.id),
},
};
},
{
skip: async () => shouldSkipMentionWorkflow(payload),
},
);
},


<Inbox
applicationIdentifier={novuApplicationIdentifier}
subscriberId={userId}
appearance={appearance}
renderNotification={(notification) => {
console.log('Notification received', JSON.stringify(notification));
return (
<div>
<h3>{notification.subject}</h3>
<p>{notification.body}</p>
</div>
);
}}
/>
And here's my FE console.log:
Notification received {"notification":
{
"notification":{
"id":"66d598377b008e3d36f88668",
"subject":"Eden Lender mentioned you in a comment",
"body":"wow let's go Totally different person Another Person Eden Lender",
"to":{
"id":"66bca3ac9314a600ef264457",
"subscriberId":"607a88f8-bfc4-4675-83c6-f1a9894cd797"
},
"isRead":true,
"isArchived":false,
"createdAt":"2024-09-02T10:49:27.551Z",
"readAt":"2024-09-02T10:49:33.945Z",
"channelType":"in_app",
"tags":[

]
}
}
Notification received {"notification":
{
"notification":{
"id":"66d598377b008e3d36f88668",
"subject":"Eden Lender mentioned you in a comment",
"body":"wow let's go Totally different person Another Person Eden Lender",
"to":{
"id":"66bca3ac9314a600ef264457",
"subscriberId":"607a88f8-bfc4-4675-83c6-f1a9894cd797"
},
"isRead":true,
"isArchived":false,
"createdAt":"2024-09-02T10:49:27.551Z",
"readAt":"2024-09-02T10:49:33.945Z",
"channelType":"in_app",
"tags":[

]
}
}
I'd love some help with this since it's preventing us from going to production with the dependant feature and also prevents us from using the business tier. Thank you so much 🙏
14 replies
NNovu
Created by Eden on 8/25/2024 in #💬│support
primaryAction.url doesn't seem to be working with the new notificationCenter
Hey! we started implementing novu into our system and we've been loving the ease of use so far. After implementing a few workflows emails, and delays, we started implementing the NotificationCenter and we're currently running into issues with the url and other payloads from step.inApp for some reason no matter which url i use in primaryAction.url the button in the notification center doesn't redirect to the url, when i tried to implement a custom onClick, i don't see any of the params i pass through the return type of step.inApp, no primaryAction.url no someOtherParam nothing gets to the frontend onPrimaryActionClick function. Here's my return type:
await step.inApp(
'send-mention-notification',
async () => {
const data = await fetchRelatedData();
return {
body: jsonDocument,
primaryAction: {
label: 'View Comment',
url: https://google.com //This won't pass to the "view comment" button in the notificationCenter or to the onNotificationClick method
},
someOtherParam: 'someOtherValue', // this will also not go through
subject: controls.subject ?? `${mentionedByName} mentioned you in a comment`,
};
},
{
skip: async () => shouldSkipMentionWorkflow(payload),
},
);
await step.inApp(
'send-mention-notification',
async () => {
const data = await fetchRelatedData();
return {
body: jsonDocument,
primaryAction: {
label: 'View Comment',
url: https://google.com //This won't pass to the "view comment" button in the notificationCenter or to the onNotificationClick method
},
someOtherParam: 'someOtherValue', // this will also not go through
subject: controls.subject ?? `${mentionedByName} mentioned you in a comment`,
};
},
{
skip: async () => shouldSkipMentionWorkflow(payload),
},
);
Is there some way for me to debug this? i couldn't find and references for this in the documentation. Thx for the help 🙏
20 replies