smsapi2email

command module
v1.1.4-0...-9ad9f1e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2019 License: Unlicense Imports: 7 Imported by: 0

README

SMS-API 2 EMAIL

Build Status Go Report Card GitHub

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 variable DOMAIN (can be anything when using MailHog)

API

Endpoint: http://HOST:PORT/sms.do

Supported query parameters:

  • from sender name or send type (2way)
  • to phone number
  • message - content of message

Example

  • sending message using cURL
curl 'http://localhost:8080/sms.do?from=MyCompany&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

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 .

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL