Welcome to a practical Zapier tutorial! In this guide, you'll learn how to send SMS services from your marketplace for new bookings.
Specifically, what we are building here is an automated SMS message notification that is sent to the providers on your marketplace whenever a transaction is initiated with them, so they can quickly react to the booking request or the message. Of course, you can adapt this tutorial to send some other kinds of SMS notifications too.
Already familiar with setting up zaps? Find the Zap template here: Send a text message to the provider for each new booking in a Sharetribe marketplace
If you haven’t gone through the introduction and the action/event article of our Zapier collection, we encourage you to do so to better understand how things work. If you want to dive straight into action either way, feel free to read on!
About Zapier
Zapier is a powerful and versatile tool that allows you to integrate different services to one another. You can learn more about Zapier in our introductory article or through this brief video from Zapier.
About Twilio
Twilio is an online service that provides a variety of communication-related services, including SMS messaging, Whatsapp, voice calls, video calls, chat and messaging, and more. It can be used for a variety of tasks, but in the context of this tutorial, we’ll be using it to set up automatic SMS notifications to the sellers of your marketplace, notifying them every time there’s a booking made.
If you prefer Whatsapp notifications, you can try customizing this tutorial to work with them instead of SMS, since Twilio supports both.
What you need for this tutorial
External accounts
Zapier Account
Create a Zapier account if you don’t already have one. You can sign up at www.zapier.com.
During registration, Zapier may ask which apps you plan to use. You can enter Sharetribe at this point or add it later.
Twilio account
You can create one at www.twilio.com
You can start with the free plan and upgrade it later if needed
Activate the virtual number after opening the account: this is where your users will see the SMSs as coming from.
How to set up your marketplace
Your marketplace must be configured in a certain way to support this Zap. Here is how you should set things up:
At least one recent transaction
This is where Zapier will draw the information for the SMS from
Phone number in the provider's account
This is required so Twilio knows where to send the SMS
This can be achieved with the user fields feature.
With these pieces in place, let's get started!
Getting your Integration API key from Console
Navigate to Build > Advanced > Applications
Click on “+ Add a new application”
Give the application a descriptive name (like Zapier), and select ‘Integration API’.
Click ‘Add application’.
Important: Copy and paste the Client ID and Client secret to a safe place, like a password manager.
Think of the Client ID and secret as a sort of a password to your marketplace that can be used through other services. Note that you won’t be able to ever see the Client secret to this application again in the Console under any circumstances. Make sure you copy it to a secure place. If you lose it, you will need to create a new application.
Creating the Zap, step by step
(Optional) Importing a pre-existing Zap
Go to www.zapier.com and log in with your account (or create a free one, if you don't already have one)
Open the pre-made Zap for connecting Twilio to Sharetribe here.
Click on ‘Try this Zap'
Step 1: Find a recent transaction from your marketplace
Connect your Sharetribe account by entering your Client ID and Client secret
Click ‘Continue’ to move to the ‘Trigger’ section
Choose ‘Transaction initiated’ as the ‘Event type’
Click ‘Continue’ to move to the ‘Test’ section
Test the trigger, and make sure it finds a recent transaction event with the relevant details (price and phone number, and date if applicable)
Click ‘Continue with the selected record’ to move to the next step
Step 2: Retrieve the provider information
Go to the ‘Action’ section, and click on the ‘User ID’ field
Scroll down the ‘Transaction events’ list and find and choose ‘Transaction Provider Id’, and close the list
Leave ‘Included relationships’ empty, and choose ‘No’ in the dropdown ‘Should this step be considered a “success” when nothing is found?’
Click on ‘Continue’ to move to the ‘Test’ section
Click on ‘Test step’ and make sure it finds the provider’s information, including their phone number
Click ‘Continue’ to move to the next step
Step 3: Retrieve the listing information
Go to the ‘Action’ section, and click on the ‘Listing ID’ field
Scroll down the ‘Transaction events’ list and find and choose ‘Transaction Listing Id’, and close the list
Again, leave the other two fields empty/default, and click ‘Continue’ to go to the ‘Test’ section
Click ‘Test step’ and make sure the test finds the right listing, with its title and other relevant details
Click ‘Continue’ to move to the next step
Step 4: Retrieve additional transaction information
Go to the ‘Action’ section, and click on the ‘Transaction ID’ field
Open the ‘Transaction events’ list and find and choose ‘Transaction Id’, and close the list
In the ‘Included relationships’, choose ‘Booking’, ‘Customer’, and ‘Messages’
Choose ‘No’ in the dropdown ‘Should this step be considered a “success” when nothing is found?’, and click ‘Continue’ to go to the ‘Test’ section
Click ‘Test step’ and make sure the test find the right transaction, with its price and other relevant details, such as date
Click ‘Continue’ to move to the next step
Step 5: Format the transaction price to currency units
Note: In this example, we assume the pricing is in Dollars. In the Sharetribe system, the price is displayed originally as a simple number without decimals, meaning that the price is in cents. Since people are used to seeing prices in full Dollars/Euros/etc., you’ll need to divide the original price by 100 to get the price in the ‘normal’ currency unit. If the currency your marketplace is using does not have cent equivalents at all, you may not need to perform this step at all.
Go to the ‘Action’ section, and choose ‘Perform Math Operation’ in the ‘Transform’ field
In the ‘Operation’ field, choose ‘Divide’
In the ‘Input’ field, scroll down the ‘Transaction Events’ list and choose ‘Transaction Payin Total Amount’
Close the list, and choose the field below, and enter 100
Click ‘Continue’ to go to the ‘Test’ section
Click ‘Test step’, and make sure that the output of the test is in full dollars/euros
Click ‘Continue’ to move to the next step
Step 6: Format the transaction start date to a human readable format
Go to the ‘Action’ section, and choose ‘Format’ in the ‘Transform’ field
In the ‘Inputs’ field, choose ‘4. Show Transaction in Sharetribe’, and choose ‘Transaction Booking Start’
In the ‘To Format’, choose your preferred date format (such as DD/MM/YYYY)
Leave the other fields empty/default, and click ‘Continue’ to go to the ‘Test’ section
Click on ‘Test step’, and make sure the ‘Output’ is in the date format you want your provider to see in the SMS message
Click ‘Continue’ to move to the next step
Step 7: Format the transaction end date to a human readable format
Go to the ‘Action’ section, and choose ‘Format’ in the ‘Transform’ field
In the ‘Inputs’ field, choose ‘4. Show Transaction in Sharetribe’, and choose ‘Transaction Booking End
In the ‘To Format’, choose your preferred date format (such as DD/MM/YYYY)
Leave the other fields empty/default, and click ‘Continue’ to go to the ‘Test’ section
Click on ‘Test step’, and make sure the ‘Output’ is in the date format you want your provider to see in the SMS message
Click ‘Continue’ to move to the next step
Step 8: Construct the SMS message from the available data
In the ‘Account’ section, Sign in with your Twilio account with the Account SID and Auth Token, which you can find from the ‘Live credentials’ section at: https://console.twilio.com/us1/account/keys-credentials/api-keys
Click ‘Continue’ to go to the ‘Action’ section
In the ‘From Number’, choose the standard number you activated when you created your Twilio account (if you didn’t, you can go activate one now)
(Optional) Add an alphanumeric sender ID, if you want, such as "Biketribe". This will be displayed instead of the number if the receiving person's phone supports it
In the ‘To Number’, open the “2. Show User in Sharetribe” list, and find “User Profile Protected Data Phone Number” (the last words may be different depending on what you chose as the key)
In the ‘Message’ field, you can now write in the message you want your provider to receive, and include the information that you want. When constructing the message, you will need to select multiple different variables that are placed within the message. The message could be, for example:
“[3. Listing title] was just booked on Biketribe by [4. Transaction Customer Profile Display Name], from [6. Transaction Booking Start] until [7. Transaction Booking End], for $[5. Output] USD! Go to Biketribe at www.example.com to confirm the booking.”
This would translate to something like:
“Mountain bike was just booked on Biketribe by John, from 01/01/2024 until 01/05/2024, for $200 USD! Go to Biketribe at www.example.com to confirm the booking.”
6. Leave Media URL empty, and make your selection for ‘Send Large Messages’ based on how long you expect your messages to be. If your messages are over 160 characters and you choose ‘No’ here, the end of the message will be cut off.
7. Go to the ‘Test action’ and test the zap. If everything went well, you should now get a text message about the booking to the number associated with the transaction (ideally, you entered your own number here, so you can see the received message).
Final thoughts
Thanks for reading this tutorial about creating a Zap for your Sharetribe marketplace to send SMS confirmations to providers for new transactions via Twilio! Feel free to read through other parts of our Zapier guide as well: the Introduction and the article about Events and Actions. Also, there's a tutorial for a zap for the Mailchimp email service.
Please get in touch with us from your Console or from the bottom right section of this page from the chat widget if you have any questions about this guide, or anything else. We'll be happy to help!