Send SMS automatically from Zoho CRM (using SMS Magic)

02.24.23 12:48 PM By Andy

What we are going to do

In this tutorial we are going to show you how to automatically send text messages from Zoho CRM using SMS Magic. We are going to do it in 2 different ways: sending the message after the stage changes, as well as based on a date/time field.


To be more specific: First, we are going to create a webhook that, when called, will send all the information to SMS Magic. Then, we are going to use the webhook as an action in our workflows. So, when the workflows are triggered, they will call the webhook, and it will send all the information needed to SMS Magic, which will send the text message.


This is part 3 of the SMS Magic - Zoho CRM Integration series, so make sure to check out the other two tutorials where we go over how to configure the SMS Magic extension.

Pre-requisites

For this example, we are going to use the Deals module, where we already added 2 fields to the layout:
1) A phone field where the phone number is going to be located
2) A "date/time" field that we are going to use to send the tex message based on a date

Creating a webhook in Zoho CRM

  1. In Zoho CRM, go to the Setup.
  2. The go to Actions > Webhooks > and click on "Configure Webhook".
  3. Name the webhook.
  4. The method is going to be POST.
  5. Go to your SMS Magic account and click on Automation, on the "Get Started" page.
  6. Copy the URL to notify.
  7. Back in the CRM, paste the URL in the field "URL to notify".
  8. Select "deals" as the module
  9. Go to the "body" section, and select "form data" as the "type".
  10. Under "user defined format", click on "add parameter".
  11. The Parameter name is going to be "text".
  12. The parameter value is in SMS Magic. Go back to your SMS Magic account.
    1. Click on "Generate JSON".
    2. The module is going to be Deals.
    3. Then, select the Sender ID.
    4. Select a phone field that you want to use to send the text message to.
    5. On "message body" type the text message (you can use merge fields from the CRM).
    6. Now click on "generate JSON".
  13. Click on "copy to clipboard".
  14. Back in the CRM. And paste the value in the "parameter value" box.
  15. Save the webhook.

Triggering the webhook with a workflow

  1. In Zoho CRM, go to the Setup.
  2. Go to "workflow rules", and click on the button "create rule".
  3. Select Deals as the module.
  4. Name it "SMS Notification".
  5. Click on Next.
  6. The execution is "on a record action".
  7. Set up the criteria. For this example we are going to use:
    1. When we edit the record.
    2. Specific field gets modified.
    3. The field is "stage". Modified to "the value". Select "proposal/price quote".
  8. Click on Next.
  9. Set up the conditions. For this example we are going to apply the rule to "all deals".
  10. Click on Next.
  11. On "instant actions" choose "webhook".
  12. Select the webhook created in the previous step.
  13. Click on "Associate".
  14. Save the Workflow.

The workflow has been created, so you can test it out by modifying a Deal's stage, if you set the same conditions we set on this example.

If you would like to send the text messages based on a date time field:
  1. Go to the Zoho CRM Setup and click on "workflow rules".
  2. Create Rule.
  3. Select "deals" as the module, add a name, and click on Next.
  4. Choose "on a date/time" as the trigger.
  5. Choose the date time field you want to trigger this workflow.
  6. Configure the other parameters: Execution date and execution time.
  7. Click on next.
  8. Add a condition if needed.
  9. Click on Next. 
  10. The instant action is "webhook".
  11. In the new window, choose the webhook we created earlier.
    If you want to send different text messages, you have to create one webhook per template. There are ways to automate this, but we are not going to cover it in this tutorial.
  12. Click on associate.
  13. Save the Workflow.