/twilio-saasmart-demo

Send notifications on different channels with Twilio and SendGrid.

Primary LanguageJavaScriptMIT LicenseMIT

Send notifications on different channels with Twilio and SendGrid.

This repository demonstrates how to send notifications over SMS, WhatsApp, Voice (calls), and Email.

This project was bootstrapped with Create React App. Then an Express server was added in the server directory. The server is proxied via the proxy key in package.json.

Requirements:

  1. Twilio Account
  2. SendGrid Account

To send messages with WhatsApp in production, you have to wait for WhatsApp to formally approve your account. But, that doesn't mean you have to wait to start building. Twilio Sandbox for WhatsApp lets you test your app in a developer environment.

Product documentation:

  1. Programmable SMS
  2. Programmable Voice
  3. Amazon Polly TTS TwiML
  4. WhatsApp
  5. Email

Using this project

Clone the project, change into the directory and install the dependencies.

git clone https://github.com/jonedavis/twilio-saasmart-demo.git

cd twilio-saasmart-demo

npm install

Create a .env file for environment variables in the root directory of this project.

Example:

TWILIO_ACCOUNT_SID=ACCOUNT_SID_HERE
TWILIO_AUTH_TOKEN=AUTH_TOKEN_HERE
SENDGRID_API_KEY=API_KEY_HERE

Read the blog post How To Set Environment Variables to learn more.

You can start the server on its own with the command:

npm run server

Run the React application on its own with the command:

npm start

Run both applications together with the command:

npm run dev

The React application will run on port 3000 and the server port 3002.