Set up SMS Settings
ERPNext sends SMS (text messages) through an SMS gateway provider. The provider must offer an HTTP API: a web address that sends an SMS when ERPNext calls it. After the setup, you can send SMS from documents, from the SMS Center, and from notifications.
Prerequisites
- An account with an SMS gateway provider.
- The provider's HTTP API documentation, with the URL and its parameters.
- The System Manager role.
Read the gateway URL
A provider's API documentation shows a URL like this one:
text
https://sms.example.com/send.php?username=abcd&password=abcd&to=9900XXXXXX&sender=DEMO&message=THIS+IS+A+TESTThis URL sends the message "THIS IS A TEST" from account abcd to the number 9900XXXXXX, with the sender ID DEMO. The URL has three kinds of parts:
| Part | In the example | Where it goes in ERPNext |
|---|---|---|
The address before the ? | https://sms.example.com/send.php | SMS Gateway URL |
| The parameter for the message text | message | Message Parameter |
| The parameter for the mobile number | to | Receiver Parameter |
| Parameters that never change | username, password, sender | Static Parameters table |
Enter the settings
- Open SMS Settings.
- In SMS Gateway URL, enter the address before the
?. - Enter the Message Parameter and the Receiver Parameter.
- In the Static Parameters table, add one row for each fixed parameter, with its value.
- If the provider needs a POST request, select Use POST.
- Select Save.
To test the setup, open the SMS Center, and send a message to your own number.
Example: Voip.ms
- In your Voip.ms account, open Main menu > SOAP and REST/JSON API. Turn on the API, set an API password, and allow the IP address of your server.
- In DIDs, turn on SMS for the number that sends the messages.
- In ERPNext SMS Settings, enter:
- SMS Gateway URL:
https://voip.ms/api/v1/rest.php - Message Parameter:
message - Receiver Parameter:
dst
- SMS Gateway URL:
- Add these Static Parameters:
api_username: your Voip.ms account username.api_password: the API password.method:sendSMS.did: the 10-digit number that sends the SMS.