/plivo-sms-slack-hook

Plivo hook to receive SMS messages and send them to a Slack channel.

Primary LanguageJavaMIT LicenseMIT

Travis (.org) branch Codecov Code Climate maintainability Docker Pulls GitHub tag (latest by date)

Plivo SMS Slack Hook

Plivo hook to receive SMS messages and send them to a Slack channel.

Usage

docker run -d nl2go/plivo-sms-slack-hook \
    -e PLIVO_SMS_SLACK_HOOK_WEBHOOK_URL=https://hooks.slack.com/services/foo-bar \
    -e PLIVO_SMS_SLACK_HOOK_TARGET_NUMBER=123123123 \
    -p 8080:8080

A message may be sent using /messages endpoint.

curl \
    --request POST 'http://localhost:8080/messages?From=123&To=1&Text=HelloWorld' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode '='

Configuration

Configuration is supported through environment variables.

Name Description
PLIVO_SMS_SLACK_HOOK_WEBHOOK_URL Slack incoming webhook URL.
PLIVO_SMS_SLACK_HOOK_MESSAGE_TEMPLATE Slack webhook message template.
PLIVO_SMS_SLACK_HOOK_TARGET_NUMBER Plivo managed phone number that is capable of receiving the SMS. Used as authorization verification.

Defaults may be found within application.yml.

Prerequisites

  • OpenJDK 11
  • Docker >=17.x
  • Docker Compose >=2.3

Development

$ mvn clean package
$ docker-compose up -d

Maintainers

License

See the LICENSE.md file for details