https://github.com/vtfk/azf-send-sms
Azure function for sending SMS
https://github.com/vtfk/azf-send-sms
Last synced: 2 months ago
JSON representation
Azure function for sending SMS
- Host: GitHub
- URL: https://github.com/vtfk/azf-send-sms
- Owner: vtfk
- License: mit
- Created: 2019-09-22T09:06:38.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-11-08T09:42:18.000Z (over 1 year ago)
- Last Synced: 2025-01-23T12:32:06.979Z (4 months ago)
- Language: JavaScript
- Size: 119 KB
- Stars: 1
- Watchers: 4
- Forks: 2
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.com/vtfk/azf-send-sms)
[](https://github.com/feross/standard)# azf-send-sms
HttpTriggered sending of SMS with [PSWinCom/LinkMobility](https://pswin.com/)
# Usage
POST json to function.
```javascript
{
"receivers": ["4798765432", "4745678912"], // Required (10 digits) - must have country codes prefixed!
"message": "", // Required
"sender": "", // Optional
"operation": 9 // Optional
}
``````
$ curl https://azf-send-sms.azurewebsites.net/ -d "{ "receivers": ["4745678912"], "message": "Do you read me?" }" -H "Content-Type: application/json" -v
```## Deploy
### Azure
You"ll need a valid subscription and have the following resources setup:
- resource group
- app service plan
- storage account#### Setup function
The easiest way to make this function run is to setup an app service, configure the app and get the function from GitHub.
- add function app
- Runtime stack -> NodeConfiguration for app (Application settings):
```javascript
{
"PSWIN_USERNAME": "username",
"PSWIN_PASSWORD": "password",
"DEFAULT_SENDER": "VTFK"
}
```- add function
- Plattform features -> deployment center
- github
- branch master## Development
1. First - install all tools needed for [local development](https://docs.microsoft.com/en-us/azure/azure-functions/functions-develop-local).
2. Clone the repo. Install dependencies.
3. Create a local.settings.json file:
```javascript
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "node",
"PSWIN_USERNAME": "username",
"PSWIN_PASSWORD": "password",
"DEFAULT_SENDER": "VTFK"
}
}
```4. Start server:
```
$ func start
```POST testdata
```
$ curl http://localhost:7071/api/SendSMS -d "{ "receivers": ["+4745678912"], "message": "Do you read me?" }" -H "Content-Type: application/json" -v
```# License
[MIT](LICENSE)