Insites Docs Developer Guide NotificationsCreating an SMS Notification

Creating an SMS Notification

Last updated on March 10, 2024.

This document discusses creating an SMS Notification to send a text message to a newly signed-up user using our Twilio integration.

Note

If you want to send the SMS via GraphQL, please check the GraphQL Mutation.

Prerequisites

To follow the steps in this tutorial, you must understand how notifications work. Use the sign-up form created in a previous tutorial and the user property. You also need to ensure that the number is formatted according to Twilio's phone number format guideline.

Steps

Creating an SMS Notification is a two-step process:

  • Step 1: Create an SMS Notification
  • Step 2: Add the SMS Notification to the Sign-Up Form

Step 1: Create an SMS Notification

app/smses/welcome_user.liquid

This assumes that you have already created a Sign-Up Form and configured the phone_number property.

The phone number should include a country code. On the production site, users might need to learn their country code or what a country code is. For simplicity in this example, though, assume that the user provides the correct input. For production, you might find the to_mobile_number Liquid filter useful.

Step 2: Add the SMS Notification to the Sign-Up Form

Add your SMS Notification to the Sign-Up Form configuration.

The SMS notification name is a path of the file relative to the directory, without extension.

In our example, the path to the file is app/smses/welcome_user.liquid, and the bolded part is the name - . As the result of adding:

to the Sign-Up Form, the content of in the configuration section should look as follows:

Important

If the SMS does not arrive to your phone after a minute, please check the logs in the Insites CLI Tool using the command . You will find information about the issue if you configured the Form and SMS correctly. For example, the phone number might be in an invalid format (missing country code), or if you are developing on a Staging Instance, you might need to ensure that in your Instance configuration, has SMS and API workflows enabled.

Next steps

Congratulations! You have created an SMS Notification. Now you can learn about creating an API Call Notification: Creating an API Call Notification

Have a suggestion for this page?

Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.