-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Milestone
Description
I'm using novu-dotnet 0.6.0.
I could notify a subscriber by its id:
var payload = new Dictionary<string, object>()
{
{ "key1", "value1" },
{ "key2", "value2" }
};
var eventData = new Novu.Domain.Models.Events.EventCreateData()
{
EventName = "test-in-app",
To = new Novu.Domain.Models.Events.EventTo()
{
SubscriberId = "ca6f045a-668d-4232-b76e-f37acafc9eb6"
},
Payload = payload
};
var response = await novu.Event.Trigger(eventData);
But there is no way to trigger a notification by topic and notify all subscribers associated with that topic. The EventCreateData.To property is too limited, as it doesn't allow specifying a topic key. There is also no overload Trigger() method to support this.
However, if I directly use Novu API I can successfully associate a subscriber to a topic (topicA):
https://api.novu.co/v1/topics/topicA/subscribers
{
"subscribers": ["ca6f045a-668d-4232-b76e-f37acafc9eb6"]
}
And then notify all subscribers (including the above one) associated with that topic:
https://api.novu.co/v1/events/trigger
{
"name": "test-in-app",
"to": [
{
"type": "Topic",
"topicKey": "topicA"
}
],
"payload": {}
}
Metadata
Metadata
Assignees
Labels
No labels