Messaging

Textmagic

Send SMS messages to your Nuvix users using Textmagic and Nuvix Messaging.

Textmagic lets you send customized SMS messages to your users. These SMS messages can be sent immediately or scheduled. You can send SMS messages for purposes like reminders, promotions, announcements, and even custom authentication flows.

Add provider

To add Textmagic as a provider, navigate to Messaging > Providers > Add provider > SMS.

Give your provider a name > choose Textmagic > click Save and continue. The provider will be saved to your project, but not enabled until you complete its configuration.

Configure provider

In the Configure step, you will need to provide details from your Textmagic dashboard to connect your Nuvix project.

You will need to provide the following information from your Textmagic dashboard:

Field nameDescription
API keyHead to Textmagic dashboard > Services > API > Add new API key.
UsernameHead to Textmagic dashboard > My account > Username.
Sender numberHead to Textmagic dashboard > Services > Sender settings.

After adding the following details, click Save and continue to enable the provider.

Test provider

Before sending your first message, make sure you've configured a topic and a target to send messages to.

To send a test message, navigate to Messaging > Messages > Create message > SMS.

Add your message and in the targets step, select one of your test targets. Set the schedule to Now and click Send.

Verify that you can receive the message on your phone. If not, check for logs in the Nuvix Console or in your provider's logs.

To send a message programmatically, use the Nuvix Server SDK.

import { Client } from '@nuvix/client';

const nx = new Client()
  .setEndpoint('https://api.nuvix.in/v1')
  .setProject('<PROJECT_ID>')
  .setKey('<API_KEY>');

const message = await nx.messaging.createSms({
  messageId: '<MESSAGE_ID>',
  content: '<CONTENT>',
  topics: [],                                   // optional
  users: [],                                    // optional
  targets: [],                                  // optional
  draft: false,                                 // optional
  scheduledAt: ''                               // optional
});

You can follow the Send SMS messages journey to send your first SMS and test your provider.

Manage provider

You can update or delete a provider in the Nuvix Console.

Navigate to Messaging > Providers > click your provider. In the settings, you can update a provider's configuration or delete the provider.

To update or delete providers programmatically, use the Nuvix Server SDK.

import { Client } from '@nuvix/client';

const nx = new Client()
  .setEndpoint('https://api.nuvix.in/v1')
  .setProject('<PROJECT_ID>')
  .setKey('<API_KEY>');

// update Textmagic provider
const provider = await nx.messaging.updateTextmagicProvider(
  '<PROVIDER_ID>',
  '<NAME>',                    // name (optional)
  false,                       // enabled (optional)
  '<USERNAME>',                // username (optional)
  '<API_KEY>',                 // apiKey (optional)
  '<SENDER_NUMBER>'            // from (optional)
);

// delete provider
await nx.messaging.deleteProvider('<PROVIDER_ID>');

How is this guide?

Last updated on

Textmagic