Skip to contentSkip to navigationSkip to topbar

Trigger SMS based on Segment Events

Created by: Twilio
  • SMS
  • JavaScript
  • Quick Deploy
(information)

Info

Regulations require that you first register your number to use these resources to send SMS traffic to US and Canadian mobile destinations. If you are sending to Canada or the US and have not already done so, please see our documentation to register your Twilio phone number(link takes you to an external page) or Toll-Free number(link takes you to an external page) before you use this template.

How it works:

  • Uses Twilio Functions to host the webhook for Segment
  • Uses Segment's Webhooks destination(link takes you to an external page) to receive event notifications to the app
  • Sends out an SMS to a number when a Segment event occurs

Notes:

Report this template(link takes you to an external page)
Quick Deploy to TwilioGet CodeUse Twilio CLI
Launch and test this app in a few minutes with Quick Deploy. No server needed. Quick Deploy will automatically configure and deploy this app using Twilio Functions. Learn more about Twilio Functions(link takes you to an external page)
  1. Log in to Twilio

    Access your Twilio account to get started.

    Checking for existing account...

  2. Get a Twilio phone number

    Your app requires a Twilio phone number to operate, this is your application's source number to receive messages or calls.

    You will get a US number that is configured for this application. You can change this or port over an existing number later. International number regulations(link takes you to an external page)
  3. Segment Event

    The name of the Segment event you want to be notified about

  4. My Phone Number

    Segment event notifications will be sent to this E.164-formatted phone number

  5. Click the button below to deploy your app

    This will use the details entered above to deploy your application to Twilio Functions.

    You will be able to view the application in the browser and edit it using the Functions UI.

Need some help?

We all do sometimes; code is hard. Get help now from our support team(link takes you to an external page), or lean on the wisdom of the crowd by browsing the Twilio tag(link takes you to an external page)on Stack Overflow.

Terms of servicePrivacy Policy

Copyright © 2025 Twilio Inc.