expiry for notifications
Is there a way to expire the notifications?
Let's say I run a weekly worker to send a notification, I want to remove the notification after 2 days, is that possible?
17 Replies
Hi @ManwinderSingh, I'm an AI assistant for Novu. While a team member reviews 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 send PUSH notifications to iOS devices with FCM using Novu
* Workflows
* Data Migrations
* Digest Engine
-----------------------------
Answer
Currently, Novu notifications have a default expiration time of 12 months, and there isn't a built-in feature to customize this expiration time to a shorter period like 2 days. This limitation means that automatically expiring notifications after a specific short duration, such as 2 days, isn't directly supported within Novu's existing features as of the latest information available (1) .
For use cases requiring notification expiration sooner than the default, you might need to implement a custom solution outside of Novu to manage and delete notifications based on your specific requirements.
Got it. Tagging @Support for additional help.
@Pawan Jain @Emil Please help here
@ManwinderSingh, you just advanced to level 2!
@ManwinderSingh
Sorry for delayed response.
Are you looking to permanently delete the in-app message for user after 2 days?
Yes
It can be done using delete message api
https://docs.novu.co/api-reference/messages/delete-message
Sorry for some silly questions, but where can I find the message id ?
For this I will have to create a daily-worker and store the IDs which I need to expire explicitly right?
Yes, you will need to store messageId for that
Where will I get the Message ID?
while triggering it ?
It will require another api call
You can use this api instead
It will delete all meessages related to transactionId
transactionId will be returned when you trigger the workflow
Alright okay thanks. It would be helpful
@Pawan Jain Just to confirm
In case I trigger a workflow for topic, I will get single transactionId for that right?
and when I trigger this delete api call, that should ideally delete the notifications ?
using above api all messages generated due to trigger to of that topic will be deleted
Wow! that sounds good