N
Novuβ€’9mo ago
gigo1980

Question with Fetching Unread Messages for Specific Topics in Daily/Weekly Digests

We have implemented a system where "topics" (groups) are utilized to send "events" (messages/notifications) to all "subscribers" (members) of the group. The requirement is to send a digest email to subscribers on a daily or weekly basis, summarizing all unread messages. Additionally, if a subscriber logs in during a digest period, they should be able to mark all messages as read or potentially delete them up until a certain "initial publication date". How to do this with the API, at the notification endpoint there not info about the "topic".
16 Replies
Pawan Jain
Pawan Jainβ€’9mo ago
@gigo1980 here you are sending in-app notification to subscribers?
gigo1980
gigo1980β€’9mo ago
Hi @Pawan Jain . Not yet. We try to send a summary on a daily base by email. So if anyone is doing anything in the group the members should be notified if they are not online at the moment. For example 1pm someone is doing something in a group, event trigger (for a topic, groupname) will be fired. my user goes 2 pm online and take a look into that group, that I will delete old messages (triggered events until now for the related group). 1 hour later someone else will do something in that group. At the end of the day a summary should be generated for all events that could happen, if no message for a subscriber exists nothing would be send.
Pawan Jain
Pawan Jainβ€’9mo ago
@gigo1980 Thanks for sharing the use case, You can use our digest feature checkout the docs https://docs.novu.co/workflows/digest
gigo1980
gigo1980β€’9mo ago
Hi @Pawan Jain I am still using digest. So the thing is more, one Person is writing into a chat a message, than we fire the notification. If the user delete this message it should be also deleted. For the broadcating in the chat room we are using topics. Each Chatroom is a topic and the members are subscribers. And now we have the situation a person deletes this messages, how does this affect the generated notifications to all the subscribers? So If I have 2 subscribers on a topic and send a message to the workflow I will get 2 messages with the same "transactionId"
Pawan Jain
Pawan Jainβ€’9mo ago
One way is to send another notification informing this deletion to all except (who deleted)
gigo1980
gigo1980β€’9mo ago
What I can do is, I can query the message endpoint get all messages and than delete one by one.
Pawan Jain
Pawan Jainβ€’9mo ago
or delete earlier sent notification by transactonid
gigo1980
gigo1980β€’9mo ago
At the moment there is only a endpoint like DELETE /v1/message/{messageId}
Novu_Bot
Novu_Botβ€’9mo ago
@gigo1980, you just advanced to level 1!
Pawan Jain
Pawan Jainβ€’9mo ago
gigo1980
gigo1980β€’9mo ago
ahh ok πŸ™‚
gigo1980
gigo1980β€’9mo ago
Ok that I will double check the openApi spec.
gigo1980
gigo1980β€’9mo ago
But good to see that there is an openapi Spec, I still have created a Postman Collection for my personal use
No description
gigo1980
gigo1980β€’9mo ago
And is the "actor" concept still described in the documentation? I think there is something missing to understand it.
Pawan Jain
Pawan Jainβ€’9mo ago
Yeah checkout actor concept with topic documentation https://docs.novu.co/subscribers/topics#exclude-actor-from-topic-trigger-event