Closed chauandrew closed 1 year ago
Good catch I completely missed that. Seems like this ticket makes sense as an API change, and the other as a front end change once this is finished. But I'm new to the codebase, so open to feedback / other suggestions!
Can I pick up this ticket?
cc:- @scopsy
Sure thing @chauandrew!
Hi @scopsy - sorry about this, recently learned that I'm not supposed to be contributing to any open source projects. Don't think I can take this on. But if I'm able to get permission in the future I'll try to contribute!
Thanks!
@scopsy I would like to pick this up
I also have similar use case:
Say you produce an invoice at the beginning of the month.
On day 1, you create a new invoice and send a reminder to the user. On day 2, the user has not paid, so you send another reminder. On day 3, the user has not paid, so you send another reminder. ...and so on.
Then, you want to view all the reminders you have sent for this particular invoice. Is there a way to view/paginate those reminders? How can this be done?
Use the invoice_id
as the subscriber_id
. Then, use the existing search functionality to search by subscriber_id
.
curl https://api.novu.co/v1/notifications?search=${INVOICE_ID}
"invoice_id": 123
when sending a notification.await novu.trigger('TAG', {
metadata: {
invoice_id: 123,
},
// ...
});
"invoice_id" === "123"
. This fetches the desired result and allows for pagination.curl https://api.novu.co/v1/notifications?metadata_invoice_id=123
This is the pattern used by the Postmark API:
Hi, I'm Jarvis š¤
I'm a bot built to help you with your contribution to Novu. I will add instructions and guides on how to run the subset of the Novu platform associated to this issue and make your first contribution.
This issue was tagged as related to @novu/api
and the related code is located at the apps/api
folder, here is how I can help you:
hey @chauandrew š the functionality will be implemented in the PR #3939 ;)
š Feature description
At the moment, we can query notification meessages/feeds by
page
,feedId
,seen
,read
,subscriberId
,channels
, etc. It would be helpful to query by custom data inmessages.payload
š¤ Why is this feature needed ?
I work on a web app where we are trying to migrate our existing notification systems to Novu. One feature of our existing notification system is that we are able to filter notifications by their 'component type', or a subsection of the app. As we transition to Novu, we can store this custom data within a notification payload, but we run into compatibility issues since we are unable to filter by these features.
āļø How do you aim to achieve this?
I would like to expand the
GET /v1/notifications
api to take custom data as input.Specifically, I think it will involve the following:
@novu/dal/src/repositories/messages/message.repository.ts > MessageRepository > getFilterQueryForMessage()
to take custom payload data as input@novu/api/src/app/widgets/usecases/get-notifications-feed
and the correspondingStoreQuery
object to take custom payload datašļø Additional Information
No response
š Have you spent some time to check if this feature request has been raised before?
š¢ Have you read the Code of Conduct?
Are you willing to submit PR?
Yes I am willing to submit a PR!
NV-2374