handle my product with notification
I want to pass a function which will do some operations in my peoduct, lets say open a modal. Is that possible through novu?
11 Replies
Hi @ManwinderSingh, I'm an AI assistant knowledgeable about Novu. While a team member is able to review this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @Ask Inkeep with any follow-up questions.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* How to use Novu to send notifications to a channel in a Discord server
* General
* Frequently Asked Questions
* How to use Headless Notification Center
-----------------------------
Answer
Novu is primarily focused on managing and sending notifications across various channels such as in-app notifications, emails, SMS, and chat platforms like Discord. It provides an infrastructure for sending these notifications, but it doesn't directly handle executing client-side operations such as opening modals within your application (1) (2) (3) (4) (5) .
To perform operations like opening a modal in response to a notification, you would typically handle this in your application's frontend logic. For example, you could listen for a specific event or notification within your app, and when that event is triggered, execute the function to open the modal. This would be managed by your application's code, not directly by Novu.
Novu does support customizing notifications and embedding variables or data within them, which you could use to indicate to your application that a modal should be opened. However, the action of reading this data and executing the corresponding operation (like opening a modal) would be something you'd implement on the client side of your application, using your frontend framework or vanilla JavaScript (2) (4) .
For handling notifications within your app and then performing actions like opening modals, consider using Novu's Headless Notification Center. It allows you to integrate notification functionality directly into your web applications, offering you the flexibility to control what happens when a notificatio
n is received, including executing functions like opening a modal (4) .
In summary, while Novu can help manage and deliver notifications that could trigger actions like opening a modal, the actual logic to open the modal would be implemented in your product's frontend code, outside of Novu's direct capabilities.
@ManwinderSingh Do you want to elaborate about the functions you are are talking about?
Lets say the function contains, an api call that will return me some html to be rendered on my product.
@ManwinderSingh
are you looking for something like this?
https://docs.novu.co/notification-center/client/react/get-started#toast-notification
Not specifically this
Step 1: I create a function on my codebase.
Step 2: I send that function name from novu to the in-app notification.
Step 3: User clicks on the notification and that function should get triggered
@Pawan Jain @Emil This is how I want it to be
@Pawan Jain any updates here please?
@ManwinderSingh, you just advanced to level 1!
@ManwinderSingh
like you shared you want to send function name while triggering the workflow and then on click of the notification, invoke the function.
We partially support this
You can use notification click event to invoke any function
https://docs.novu.co/notification-center/client/react/get-started#onnotificationclick
Can we do it with plan JS? @Emil @Pawan Jain
I am using headless cdn for the client side
@ManwinderSingh
Is https://discord.com/channels/895029566685462578/1219737232689336432 similar to this ?
Yes! I think this thread can be closed, using onActionClick instead! Thanks for the support Pawan