- Node
- Twilio
- Contentful
- Open a terminal and run
git clone https://github.com/cachrisman/sms-jokes; cd sms-jokesto clone this repository. - Install the contentful-cli tool (
yarn global add contentful-cli) and use it to create a new space in Contentful -OR- use the Contentful webapp to create a new space. Copy the space ID and delivery access token. - Copy the
.env.samplefile to.envand fill in the appropriate tokens. - Run
contentful-migration -s <SPACE_ID> 01-initial-content-model.jsto create the content model in your new Contentful space. - Go to the Contentful webapp and create some new sports jokes.
- Back in your terminal, run
yarnto install dependencies. - Run
yarn start:devto start the node app locally. - In a separate terminal window, run
ngrok http 5000and copy the generated url into your Twilio dashboard under the messaging section of the phone number you want to use as a webhook. - You can also install and run
nowto deploy the app and use the given now.sh url in your Twilio dashboard.
Viola! You can now send a text message with a sport name (as defined in Contentful) to your Twilio number and you will be sent a random joke pulled from Contentful about that sport in reply!