oboratav / sms2smtp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sms2smtp

Quick-and-dirty Twilio Serverless function that receives SMS messages from one or more phone numbers, and relays them to one or more email addresses.

Setup and Use

  1. Clone this repo
git clone https://github.com/oboratav/sms2smtp.git
  1. Make a copy of routing.private.example.json under assets/, rename it to routing.private.json
cd sms2smtp
cp assets/routing.private.example.json assets/routing.private.json
  1. Edit routing.private.json such that there is a key for each Twilio phone number you will be receiving SMS messages through, and the value for each key is an array of email addresses that you need the messages to be forwarded to.
  2. Create a .env file in the root directory of the repo and populate it with the necessary environment variables:
ACCOUNT_SID=    # Your Twilio Account SID 
AUTH_TOKEN=     # Your Twilio Auth Token

MAIL_PORT=      # Mailserver config
MAIL_HOST=
MAIL_USERNAME=
MAIL_PASSWORD=
  1. Deploy
twilio serverless:deploy
  1. Change the incoming message handler for the Twilio number(s) to the new service

About

License:MIT License


Languages

Language:JavaScript 100.0%