Code Example: Text a deal via RingCentral.

Step-by-Step Instructions for Publishing the Zoho Deluge Script on Your Site

Step 1: Create a Custom Function in Zoho CRM

  1. Log in to Zoho CRM: Start by logging in to your Zoho CRM account.

  2. Navigate to Settings: Click on the gear icon (⚙️) in the top-right corner of the page to go to CRM settings.

  3. Go to Workflow Rules: In the “Automation” section, click on Workflow Rules.

  4. Create a New Workflow:

    • Choose the module as Deals since the function will run when a deal record is created or updated.
    • Define the conditions when the workflow should be triggered (e.g., when a deal is created, edited, or specific fields are updated).
    • Set the Trigger to specify when the SMS should be sent (e.g., when the contact is added to the deal).
  5. Add Custom Action: After defining the workflow rules, go to the “Instant Actions” section and click on Custom Function.

  6. Create New Custom Function:

    • Click New Custom Function.
    • Give it a name, such as “Send_SMS_to_Deal_Contact”.
    • Set the module as Deals.
    • In the function editor, paste the updated Deluge script.

     

void automation.send_RC_SMS_to_contact_of_deal(string dealID)
{
// Fetch the deal record by its ID
dealRecord = zoho.crm.getRecordById("Deals", dealID);

// Check if the Contact lookup field is available in the deal record
if(dealRecord.get("Contact_Name") != null)
{
// Get the Contact ID from the Deal
contactId = dealRecord.get("Contact_Name").get("id");
contactRecord = zoho.crm.getRecordById("Contacts", contactId); // Fetch the Contact record

// Check if the contact exists and has an ID
if(contactRecord.get("id") != null)
{
// Check if SMS_Opt_Out is false (unchecked)
if(contactRecord.get("SMS_Opt_Out") == false)
{
contactFirstName = ifnull(contactRecord.get("First_Name"), "");
contactMobile = contactRecord.get("Mobile");

if(contactMobile != null)
{
// Get the Deal Owner (optional based on your needs)
dealOwner = dealRecord.get("Owner");
ownerRecord = zoho.crm.getRecordById("users", dealOwner.get("id"));

// Retrieve the RC Account ID from the user (Owner) record
AccountId = "";
if (ownerRecord.get("users") != null)
{
AccountId = ownerRecord.get("users").get(0).get("RC_Account_ID");
}

// Define the extension ID, from number, and the message content
ExtensionId = ""; // Optional Extension ID
FromNumber = ""; // Optional From Number (use if different from account number)
MsgText = "Hi " + contactFirstName + ", just checking in to make sure you received my proposal. Let me know if you have any questions. - Matt Kakuk";

// Send the SMS using the correct API call
resp = multiuserringcentralmessagingextension.sendRcSms(AccountId, ExtensionId, FromNumber, contactMobile, MsgText);
info resp; // Log the response for debugging
}
else
{
info "Contact does not have a mobile number.";
}
}
else
{
info "Contact has opted out of SMS communication.";
}
}
else
{
info "Contact record not found.";
}
}
else
{
info "No contact associated with this deal.";
}
}

Get Started Now

Sign up for a discovery call for this extension

Simple steps

Don’t have Zoho CRM yet? Sign up here for a FREE trial.

Don’t have RingCentral yet? Fill out the form and we set you up with that also.

Step 1 :

Download the Extension

Step 2 :

Book Your Implementation Meeting

Don’t have Zoho CRM yet? Sign up here for a FREE trial.

Don’t have RingCentral yet? Fill out the form and we set you up with that also.

New RingCentral MultiUser Zoho CRM Extension BETA

Get install and support documents here

Call Today to find out more or to get started

We're here to assist you and provide the information you need.