NovuN
Novu16mo ago
Eden

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>
        );
      }}
    />


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":[
         
      ]
   }
}


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 🙏
Was this page helpful?