Build the future of communications.
Start building for free

Functions posts

  • By Anton Kushch
    Store Opt-Out data on Twilio with Functions and Sync Storing Opt-Out data on Twilio with Functions and Sync

    Staying compliant is an important part of your messaging strategy. It ensures that your senders have a high trust level from carriers and, as a result, experience lower filtering and lower risk of being blocked.

    Maintaining a clean opt-out list is one of the key pillars for compliant messaging. The Twilio platform helps you maintain customer trust via automated opt-out management (more here), and it's a great start, but under certain circumstances, opt-out information can be lost. Additionally, Twilio does not yet provide an API to retrieve opt-out data.

    All that's to say: we at Twilio strongly recommend you maintain and store opt-out data yourself. In this blog post, I'll show you how storing opt-out information can be done on the Twilio platform with Serverless Functions and Sync.

    Tutorial prerequisites

    Before we can get started building, you need to make sure you have an account with Twilio. …

    Read More
  • By Ashley Boucher
    How Your Non-Profit Can Accept Mobile Donations Using Twilio Voice, TwiML Pay, and JavaScript Copy of C03 Blog Text.png

    Mobile donations are one tool you can use to encourage support of your non-profit organization. Supporters can donate directly over the phone using an automated system, powered by Twilio Voice.

    In this article, you’ll be building an app that responds to incoming calls by asking callers to enter a donation amount and then their credit card information. This information will be captured by your payment processor to complete the charge.

    To start accepting mobile donations, follow along with this article.


    To get started with this tutorial, you’ll need the following:

    Read More
  • By Anton Kushch
    Build an Inactivity Timeout with Flex Conversations Build Inactivity Timeout Flex Conversations

    As you may know, Twilio has released Flex Conversations. This is a big step in making orchestration more reliable and straightforward within the Flex ecosystem. In a blog post here, you can learn more about Flex Conversations's new perks. Introducing Flex Conversations also opens up possibilities for new cool features to be implemented, as the Conversations API provides a broad spectrum of tools for managing participants, addresses, and the conversation lifecycle.

    One contact center feature that our customers often ask about is Inactivity Timeout. To keep your agents' productivity high, it's necessary to have an automated way to track abandoned tasks and clean them up. With the State Timers feature of the Conversations API along with Twilio Functions, it is possible now to implement an Inactivity Timeout in Flex. In this blog post, I will guide you through the configuration and code to achieve this.

    Tutorial prerequisites …

    Read More
  • By Lizzie Siegle
    SMS Notifications On Pageviews with Segment and JavaScript Copy of D03 Blog Image Round (2).png

    Twilio acquired Segment last year to help developers unify customer data across every customer touchpoint. I held off on using Segment for a while because I thought Segment was only for businesses, but I learned recently that I, an indie developer, have a use case for it. Read on to learn how to use Segment and Twilio Serverless to send SMS notifications when someone visits your website.

    Do you prefer learning via video more? Check out this TikTok summarizing this tutorial in two minutes!


    To follow along with this post, you need three things:

    Add a Segment Source

    First off, we need to add …

    Read More
  • By Jordan Hanley
    Dynamic Contact Center Opening Hours Powered by Twilio Studio and Google Places Dynamic Contact Center Opening Hours with Google Places

    The Problem

    One of the most frequent asks when building out an IVR for a contact center is for the IVR to change when the contact center is closed. To deliver a great customer experience, you may want to direct the customer online, give them different options to self-serve, send them to voicemail or simply ask them to call back at a different time.

    This kind of functionality can be built out relatively easily using Twilio Functions with Twilio Studio to lookup a spreadsheet or database and some kind of logic to decide if your business is currently open. However, this can become complex when managing public holidays, business downtime or other exceptions.

    How Can This Be Easier?

    In the online-first world that we live in, most businesses have a presence on Google, and some are even striving to be the most visible in their sector or region. As such, …

    Read More
  • By Naomi Pentrel
    Twilio's Unofficial Vote for the Eurovision Song Contest Twilio's Unofficial Vote for the Eurovision Song Contest

    Eurovision is near and while you can't officially vote just yet, we thought we'd allow the public to vote already - and not just for this year but for ALL Eurovision's that have happened since the beginning of Eurovision. That includes 2020 - the year Eurovision was cancelled.

    How do I vote?

    Text '2022' to one of the following numbers to get the list of all the 2022 participants and their youtube videos. Once you have picked a winner, text “2022 Country” to the same number (e.g. 2022 Germany).

    Netherlands: +3197010253872

    UK: +44 7401 199687

    Sweden: +46 70 192 18 32

    United States: +1 (267) 713-3577

    What about the other years... Could we maybe vote for those too?

    You can text any year from 1956 to 2022 to any of the above numbers and then vote for your favourite song.

    How do I see the results?

    You can see the …

    Read More
  • By Raphaël LE GORANDE
    Votre Première Campagne SMS Marketing en 5 minutes Votre-Premiere-Campagne-SMS-Marketing.png

    Twilio est une plateforme unique qui vous propose des API flexibles pour communiquer sur tous les canaux, y compris les SMS. Néanmoins, leur utilisation requiert nécessairement de la programmation.

    Votre CRM ou vos outils internes ne sont pas nécessairement connectés nativement avec Twilio. Dans cet article, nous vous proposons de déployer et d'utiliser une application "clés en main" pour envoyer vos premières campagnes SMS à partir de données (numéros et champs variables) contenues dans un fichier CSV, le tout sans écrire une ligne de code.

    Cette application sera déployée sur la plateforme Twilio Runtime, de cette manière vous n’avez pas à vous soucier de l’infrastructure d’hébergement.

    Ci-dessous, un screenshot de l’application que nous allons utiliser et le résultat pour l'un des destinataires.

    CSV to SMS


    Pour suivre ce tutoriel, vous allez avoir besoin des éléments suivants :

    • Une installation de Node.js sur votre machine avec un gestionnaire de paquets tel que …
    Read More
  • By Lizzie Siegle
    Celebrate St Patrick's Day: Translate English to Gaelic with Twilio Serverless, SMS, and IBM Watson Copy of C01 Blog Text (3).png

    Celebrate St. Patrick's Day on March 17th by texting a sentence to +13863564094 to translate it to Gaelic, and read on to learn how to build the app using IBM Watson, Twilio Functions, JavaScript, and the Twilio Serverless Toolkit.

    Screen Shot 2022-03-16 at 10.12.41 AM.png


    1. A Twilio account - sign up for a free one here and receive an extra $10 if you upgrade through this link
    2. A Twilio phone number with SMS capabilities - configure one here
    3. Node.js installed - download it here
    4. IBM Cloud account - sign up for a free one here

    Setup IBM Watson

    Go to the IBM Watson Cloud Translator console, select the free Lite plan, and make a new service by clicking Create on the righthand panel.

    watson create service

    Whoop whoop! You've just made y …

    Read More
  • By Miguel Grinberg
    Build a Serverless Video Chat Application with JavaScript and Twilio Programmable Video Build a Serverless Video Chat Application with JavaScript and Twilio

    In this article you are going to learn how to build a basic video conferencing solution using Twilio Video. The system is going to run on desktop and mobile web browsers, so participants will not need to download or install any software on their computers to join a call.

    The application will be coded in JavaScript, with some HTML and CSS. It will be deployed to the Twilio Serverless platform, so that you can use it to connect with family, friends or colleagues anywhere in the world without having to worry about complicated hosting solutions.

    Do you want to see what you’ll build before you start? Here is a screenshot.

    Project screenshot

    By following this article, you can learn how to create this project in small incremental steps. If you prefer to download the complete project instead of building it step-by-step, you can find the code in this GitHub repository: …

    Read More
  • By Lizzie Siegle
    How to Make a Wordle Solver with Twilio Serverless, Studio, and SMS wordle solver

    Like many word nerds and puzzle lovers, I am obsessed with Wordle, a word puzzle game created by Brooklyn-based software engineer Josh Wardle for his word game-loving partner. I made a Wordle version over SMS with Twilio Serverless to play even more Wordle, but sometimes, I get stuck while playing. Read on to learn how to build a SMS Wordle solver using Twilio Studio, Twilio Functions, the Twilio Serverless Toolkit, and the Datamuse API to find words given a set of constraints, or test it out by texting anything to +18063046212!

    This was built with my coworker Craig Dennis on my Twitch channel.


    Want a brief overview of how it's built? Check out this Tiktok!

    Prerequisit …

    Read More
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.