Home / Companies / Twilio / Blog / Post Details
Content Deep Dive

How to send text messages from your static site using Netlify, Twilio and serverless functions

Blog post from Twilio

Post Details
Company
Date Published
Author
Stefan Judis
Word Count
2,621
Language
English
Hacker News Points
-
Summary

To deploy a static site with Netlify and send text messages using Twilio, you need to create a serverless function that can react to form submissions. The function will use the Twilio helper library to send SMS messages. To do this, you need to define sensitive information like your account SID, auth token, and phone numbers in an environment file (`.env`), which should be excluded from version control using `.gitignore`. You also need to install the `netlify-lambda` package and define a build configuration that includes the serverless function directory. Once deployed, you can trigger the function by submitting the form on your static site, and it will send an SMS message to the specified recipients.