Send notification to multiples users with SDK
We would like to send an email notification to a group of subscribers. We are using topics for that (the group of subscribers could be different each time).
Repro steps:
1. Creating a topic
2. Adding subscribers
3. Trigger notification (to: topic)
4. Removing subscribers
5. Removing the topic
We observed that point 3 only registers notifications to send, and if we start removing subscribers and topics immediately after triggering notifications, emails are not sent to anybody.
What is your recommendation? How should we send notifications to multiple users at once? How to implement that in a proper way (with topics or triggering messages in a loop per subscriber?)?
4 Replies
Hey @jvinga can you add some context as to why are you removing the subscriber and the topics? what is the timeframe?
Is the list of subscribers small enough to reasonably fit in one request? If so, you can just pass a list of subscriber identifiers in the to: field when triggering the notification.
@Mei, you just advanced to level 3!
@jvinga
As shared by @Mei , one workflow can be triggered to multiple subscribers at once.
Checkout this example
https://github.com/novuhq/novu/tree/next/packages/node#trigger-workflow-to-multiple-subscribers