Telesign 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 Telesign as a provider, navigate to Messaging > Providers > Add provider > SMS.
Give your provider a name > choose Telesign > 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 Telesign dashboard to connect your Appwrite project.
You will need to provide the following information from your Telesign dashboard.
Field name | |
Customer ID | Head to Telesign portal > Profile > Customer ID. |
API Key | Head to Telesign portal > Profile > API Keys. |
Sender number | The number from which the SMS will be sent. You may need to first purchase a number from Telesign. |
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 in your inbox. If not, check for logs in the Appwrite Console or in your provider's logs.
To send a message programmatically, use an Appwrite Server SDK.
const sdk = require('node-appwrite');
// Init SDK
const client = new sdk.Client();
const messaging = new sdk.Messaging(client);
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<PROJECT_ID>') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
const messaging = await messaging.createSms(
'[MESSAGE_ID]', // messageId
'[CONTENT]', // content
[], // topics (optional)
[], // users (optional)
[], // targets (optional)
true, // draft (optional)
'' // scheduledAt (optional)
);
You can follow the Send SMS messages journey to send your first push notification and test your provider.
Manage provider
You can update or delete a provider in the Appwrite 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 an Appwrite Server SDK.
const sdk = require('node-appwrite');
// Init SDK
const client = new sdk.Client();
const messaging = new sdk.Messaging(client);
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<PROJECT_ID>') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
const provider = await messaging.updateTelesignProvider(
'[PROVIDER_ID]', // providerId
'[NAME]', // name (optional)
false, // enabled (optional)
'[USERNAME]', // username (optional)
'[PASSWORD]', // password (optional)
'[FROM]' // from (optional)
);