N
Novu2mo ago
MINIMINI

Sending SMS via TOPIC

Hello. I sent an SMS to the Twilo service via a topic with a few people in it. But only one of them can receive the message. I think it only goes to the first person in the array, but how can I send a message to all subscribers included in the topic at the same time?? PS. I used Workflows on site
5 Replies
Ask Inkeep
Ask Inkeep2mo ago
Hi @MINIMINI, I'm an AI assistant for Novu. I'll analyze available sources and get back to your shortly. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Topics * .NET * Twilio * SMS Channel Overview ----------------------------- Answer When sending an SMS through Novu using a topic, it should indeed distribute the message to all subscribers added to that topic, not just the first one in the array. To ensure you're setting up and using topics correctly with Novu and your Twilio service, here are some steps to follow based on the documentation: 1. Create a Topic: First, ensure you have created a topic correctly. When creating a topic, you use a unique identifier for that topic. Here's how you can create a topic:
import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
const result = await novu.topics.create({
key: 'unique-topic-identifier',
name: 'descriptive-topic-name',
});
import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
const result = await novu.topics.create({
key: 'unique-topic-identifier',
name: 'descriptive-topic-name',
});
(1) 2. Add Subscribers to the Topic: Ensure that you have correctly added subscribers to your topic. You can add multiple subscribers to a topic using their subscriber IDs. Here's an example:
import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
const topicKey = 'unique-topic-identifier';
const response = await novu.topics.addSubscribers(topicKey, {
subscribers: ['subscriber-id-1', 'subscriber-id-2', ...],
});
import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
const topicKey = 'unique-topic-identifier';
const response = await novu.topics.addSubscribers(topicKey, {
subscribers: ['subscriber-id-1', 'subscriber-id-2', ...],
});
3. Trigger Workflow to a Topic: Finally, when triggering a workflow to a topic, you specify the topic key in the to field, which should distribute the message to all subscribers within that topic.
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>', {
to: [{ type: 'Topic', topicKey: 'unique-topic-identifier' }],
payload: {},
});
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>', {
to: [{ type: 'Topic', topicKey: 'unique-topic-identifier' }],
payload: {},
});
Ask Inkeep
Ask Inkeep2mo ago
If you've followed these steps, all subscribers in the topic should receive the SMS message. If only one subscriber is receiving the message despite this setup, it might be necessary to review the topic configuration and the subscriber list added to that topic to ensure everything is set correctly. Additionally, ensure that there are no specific limitations or issues on the Twilio side that might affect the delivery to multiple recipients.
Sources [1] Topics
Ask Inkeep
Ask Inkeep2mo ago
Got it. Tagging @Support for additional help.
Pawan Jain
Pawan Jain2mo ago
@MINIMINI All subscribers have phone number field set? Could you please share the screenshot on how you are triggering workflow to topic?
Ask Inkeep
Ask Inkeep2mo ago
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.
Want results from more Discord servers?
Add your server
More Posts
PHP SDK using dynamic propertiesHi! We've recently updated our PHP version to 8.3, and are getting some warnings for Novu. It seems Mark All As read functionality using custom footerI am using /read API to make all the notifications to mark as read. The API is getting successfull.Do you have documentation for all the available overrides on a trigger?Do you have documentation for all the available overrides on a trigger?Is it possible to override which channels are using when triggering an event?I've searched for this but couldn't seem to find an answer. I want to know if it's possible to speciSelf-Host: Triggering workflow to topic subscribers doesn't workCan we solve this problem once and for all? Like @Mei (https://discord.com/channels/89502956668546What is diffrence on main branch and next branch?Before setting self-hosting, I want to know 😁 Can you tell me what features have been added to the Is Tenant Structure supported on self-hosting?Actually, I got a reply from Mr.Pawan that tenant structure is only supported on Cloud service. But Which one is the latest version of diagram that you guys support?I found two links of terrastruct.. Which one is the latest version for self-hosting? https://app.Handle delete topicsCan I delete the topic using a curl even if we have subscribers added to the topic?Items from development not being seen in production after promoting the changesHi guys, me and my team are experiencing an issue after changing the copy in the development stage a