aka "How to send text messages from your static site using Netlify, Twilio and serverless functions
Tell your friends how much you like 8-bit via text (SMS or WhatsApp)... every day! As much as you want!
Using serverless functions you can build all the HTTP endpoints you need to power your static sites (finally!!!). This example site uses Netlify Lambda functions to send messages to all of your friends using the Twilio API. Thanks to the usage of serverless functions your authorization token won't be exposed and it's save to use Twilio.
To set this project up yourself you can hit the button (๐) which leads you to a one-click install solution. What you need is a Twilio account and the numbers of your friends.
- Repository name
- Given name of the new repository which will be created in your GitHub account e.g.
my-8-bit-revolution
- Twilio Account SID
- You'll find your account sid in your Twilio console e.g.
AC...................
- Twilio auth token
- You'll find your auth token in your Twilio console e.g.
a8...................
(make sure to treat your auth token safe and secure โ this article gives guidance) - Bot number
- The number you bought on Twilio. This will be the number that will send messages e.g.
+4911111111111
- Message
- The message you want to spread and send your friends e.g.
8-bit rocks
- The numbers that should receive the message
- A semi-colon seperated list of phone numbers e.g.
+491234567890;+490987654321
By doing the one-click installation dialog on Netlify you created your own copy of 8-bit-revolution.netlify.com.
The process created a new GitHub project in your GitHub account. This project includes all the source code to send SMS from a static site. You can now start and tweak the styles and functionality if you'd like to.
Additionally it set up a webhook connection to redeploy the site every time you push code to the GitHub repository. Magic. ๐
You can find out more on how this is done by reading the tutorial on twilio.com.