N
Novu11mo ago
jvinga

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
Tomer Barnea
Tomer Barnea11mo ago
Hey @jvinga can you add some context as to why are you removing the subscriber and the topics? what is the timeframe?
Mei
Mei11mo ago
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.
Novu_Bot
Novu_Bot11mo ago
@Mei, you just advanced to level 3!
Pawan Jain
Pawan Jain10mo ago
@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
Want results from more Discord servers?
Add your server