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.
- Create a free Telnyx portal account
- Buy an SMS capable phone number
- Create a messaging profile
- Associate your SMS number with this messaging profile
- Obtain your API V2 authorization key
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.
- Select the “Telnyx” app
- Select the “Receive a Message” event
- Click “Continue”
- Click on the “Choose an account” dropdown
- Select “Connect a new account”
- Enter your Telnyx “v2 API Key” in the window that pops up
- 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.
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.
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 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.
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.
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.
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.
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.
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.
- Marketo SMS Marketing with Telnyx
- Marketo Text Messaging with the Telnyx SMS API
- Marketo 2 Way SMS using Telnyx and Zapier
- 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.