Drop-in replacement for SMSAPI for testing environments
Features:
- Send messages to mail address instead of SMS using simple API
- Very simple API
- REST API compatible with popular Smsapi.pl service
- Easy integration with
MailHog
How it works:
Application send messages to email address to@domain
instead of SMS
where
to
is query param in REST (this is usually phone number)domain
is environment variableDOMAIN
(can be anything when using MailHog)
API
Endpoint: http://HOST:PORT/sms.do
Query parameters:
to
phone numbermessage
- content of message
Example
- sending message using cURL
curl 'http://localhost:8080/sms.do?username=user&from=smsapi&to=666777888&message=some_message'
run in docker
Docker image krzysbaranski/smsapi2email
docker run --rm -d --env DOMAIN=example.com --env SMTP_HOST=smtp.example.com --env SMTP_PORT=25 -p 8080:8080 krzysbaranski/smsapi2email
docker-compose
docker compose setup both smsapi2email and MailHog
- mailhog: http://localhost:8025
- API endpoint: http://localhost:8080/sms.do
docker-compose up -d
run
- setup environment (optional)
export DOMAIN="mydomain"
export PORT="8090"
export HOSTNAME="localhost"
- run directly from go
go run main.go
- run from binary:
SMTP_HOST=mysmtpserver SMTP_PORT=25 ./smsapi2email
compile
go build
build docker image
docker build -t krzysbaranski/smsapi2email .