Simple callback service to receive SMS from Nexmo number and then send an email with it's content.
Built with Python, Flask and Mailgun API.
- Python 3
- Nexmo number with SMS feature
- Mailgun account
git clone https://github.com/taiyeoguns/nexmo-sms-webhook.git nexmo-sms-webhook
With a virtualenv already set-up, install the requirements with pip:
pip install -r requirements.txt
Create .env
file from example file and maintain necessary details in it e.g. Mailgun API Key, domain, email address to send to etc
cp .env.example .env
Start the Flask web server by running:
python run.py
Server should usually be started at http://localhost:5000
Use a tool like ngrok to make the local server available to the internet:
ngrok http 5000
This will expose a link such as: https://r4nd0m1d.ngrok.io
that can be used in Nexmo Webhook URL configuration.