Forward SMS to Slack, Email, & Another Number

Receiving 2FA messages or customer responses to your marketing campaigns that you want to get notified about or distribute to multiple parties? Well I’ve got you covered! This post will show you to forward SMS to Slack, email, and another phone number using the Zapier automation tool and the Telnyx CPaas platform.

In the case that you do not want to use Telnyx and just want to forward SMS to Slack or Email then there is the option to use a webhook listener to trigger the zap so long as you have a way of sending webhooks for inbound SMS.

Forward SMS to Slack, Email, & Another Number using Telnyx

If you are looking for an introduction to Telnyx and why they should be your SMS provider then look no further than the Marketo SMS Marketing with Telnyx post. See how Telnyx stacks up to Twilio, how much you can save on SMS, and all the cool features available with the Telnyx SMS API.

Before starting with the steps below make sure you have followed the Telnyx SMS Quickstart Portal Setup Guide to do the prerequisites below.

  1. Create a free Telnyx portal account
  2. Buy an SMS capable phone number
  3. Create a messaging profile
  4. Associate your SMS number with this messaging profile
  5. Obtain your API V2 authorization key
Forward SMS to Slack, Email, and Another Number using the Telnyx app in Zapier
Forward SMS to Slack, email, and another number using the Telnyx app in Zapier

Inbound SMS to Messaging Profile Trigger

Follow the steps below when creating your new Zap to set up a trigger for inbound SMS to your Telnyx messaging profiles.

  1. Select the “Telnyx” app
  2. Select the “Receive a Message” event
  3. Click “Continue”
  4. Click on the “Choose an account” dropdown
  5. Select “Connect a new account”
  6. Enter your Telnyx “v2 API Key” in the window that pops up
  7. Click “Yes, Continue”

Now any inbound SMS to any of the numbers associated with any messaging profile will trigger this Zap to run.

N.B. If you only want this Zap to run for a certain messaging profile then you can use a filter directly after this trigger (as shown in the video above) to only allow the Zap to continue if the name of the messaging profile matches.

Forward SMS to Slack

Set up the Slack action to forward the SMS to the intended destination e.g. “Send Direct Message” or “Send Channel Message” and then populate the body of the message with information about the SMS obtained from Step 1.

Forward SMS to Slack using Zapier
Forward SMS to Slack using Zapier

I would recommend choosing “Yes” for the “Include A Link To This Zap?” option so that if there is an issue it is easy to follow the link from the Slack message and start troubleshooting.

Forward SMS to Another Number

You can forward the SMS contents to a phone number using the “Send SMS” action in the Telnyx app or using Python code in a “Code by Zapier” action to make a request to the Telnyx SMS API.

Forward SMS to another number using the Telnyx app in Zapier
Forward SMS to another number using the Telnyx app in Zapier

Using Python code to make the request will allow you to factor in more complex logic and conditions before sending the message e.g. only forward the SMS if a keyword is present in the inbound text.

If you want an example of how to send an SMS with Telnyx using Python code in a “Code by Zapier” action take a look at the Send Response using Telnyx SMS API section in the “Marketo 2 Way SMS using Telnyx and Zapier” post.

Forward SMS to Email

The “Email by Zapier” action can be used to forward the SMS contents to your email address. Again I would recommend including a link to the history of this zap so that if there any issues it is easy to click the link and start debugging.

Forward SMS to email using Zapier
Forward SMS to email using Zapier

Forward SMS to Slack, Email, & URL using Webhooks

If you have a system in place that can send information about inbound SMS using webhooks then you can use the “Catch Hook” trigger event in the “Webhooks by Zapier” app. The “Custom Webhook URL” field will provide you with a destination URL that you can send the inbound SMS information to.

Forward SMS to Slack, Email, and URL using webhooks in Zapier
Forward SMS to Slack, Email, and URL using webhooks in Zapier
"Catch Hook" trigger event in Zapier
“Catch Hook” trigger event in Zapier
"Custom Webhook URL" of the "Catch Hook" trigger event
“Custom Webhook URL” of the “Catch Hook” trigger event

For example, on any Telnyx messaging profile you can forward any inbound SMS using webhooks to a primary URL or a backup URL if sending to the first URL fails.

Telnyx messaging profile webhook forwarding URLs
Telnyx messaging profile webhook forwarding URLs

If you are looking for a way to test this “Catch Hook” trigger then you can use Postman, the free API testing tool, to make a POST request to the “Custom Webhook URL”. Take a look at the Testing the Marketo API using Postman in the “Marketo API Quick Start Guide” post to learn how to make your first POST request.

Making a post request with Postman to the Zapier custom webhool URL
Postman POST request to Zapier custom webhook URL

Once you have triggered the zap then the exact same “Forward SMS to Slack” and “Forward SMS to Email” actions from above can be used to forward the SMS to Slack and email respectively.

Forward SMS to URL

Since we are on the topic of webhooks, I couldn’t resist mentioning that you can of course also forward any inbound SMS information to a destination URL using the “POST” action event of the “Webhooks by Zapier” app.

In the “Set up action” section, you can populate the body of the webhook and specify any headers and authorization that you need to make a request to the destination URL.

Forwarding SMS information to a URL using a webhook in Zapier
Forward SMS to URL using a Zapier webhook

A great site for testing your outbound webhooks is https://webhook.site/ because it gives you a URL to send information to, which it will then display as webhooks come in.

Webhook.site webhook listener
Webhook.site webhook listener

What’s Next?

Now that you have gotten your first taste of Telnyx and a sneak peek at its SMS capabilities see how you can integrate SMS notifications into your marketing automation platform using outbound webhooks to make requests to the Telnyx SMS API.

  1. Marketo SMS Marketing with Telnyx
  2. Marketo Text Messaging with the Telnyx SMS API
  3. Marketo 2 Way SMS using Telnyx and Zapier
  4. Marketo SMS Integration Example: Webinar Reminders

If you instead want to send SMS in bulk using numbers stored in a Google sheet then check out the Zapier Loop Through Array from Google Sheets post.

Leave a Reply

Your email address will not be published. Required fields are marked *