Give your brand a better way to attract, convert, and retain new and existing consumers in real-time by incorporating SMS functionality into your marketing campaign. This ensures enhanced targeting and creating better communication platform to reach your end customers. Now send messages at the right time to the right user within Zoho CRM using message360˚ extension.
In addition to the above, you can now add a workflow rule to send messages to new Leads or Contacts automatically. This helps to instantly contact new customers and reach out to them in a more personalized way.
To accomplish this, write your own custom function using our Deluge script editor in your CRM and associate it with the workflow rule.
//Note: the custom function should have "record_id" parameter
// getting record info from Leads or Contacts using the record_id
record_info = zoho.crm.getRecordById("Leads", record_id);
// getting "Mobile" field value from the record_info (you can also get "Phone" field)
mobile = record_info.get("Mobile");
if (isNull(mobile)) {
// returning since the mobile number is empty
return;
}
// trim function will remove the white spaces at the start and at the end of the mobile number.
mobile = mobile.trim();
// getting account_sid and authtoken of message360 from extension settings
account_sid = zoho.crm.getOrgVariable("message360.account_sid");
authtoken = zoho.crm.getOrgVariable("message360.authtoken");
// message360 send sms API URL
// ####### CONFIGURE VARIABLES SECTION - STARTS
// configure from number with country code
fromcountrycode = "1";
from_no = "<FROM_NUMNER>";
// configure to number country code
tocountrycode = "1";
to_no = mobile;
// setting variable "mobile" as to number
// enter the SMS text
sms_message = "Hi, This is test SMS from Zoho CRM.";
// ####### CONFIGURE VARIABLES SECTION - ENDS
if (!isNull(account_sid) && !isNull(authtoken)) {
// doing base64 encoding for account_sid and authtoken for authenticate message360.com
baseEncoded = zoho.encryption.base64Encode(account_sid+":"+authtoken);
baseEncoded = "Basic " + baseEncoded;
headers = map();
headers.put("Authorization", baseEncoded);
// setting all required parameters to the map for sending SMS
request_data = map();
request_data.put("fromcountrycode", fromcountrycode);
request_data.put("from", from_no);
request_data.put("tocountrycode", tocountrycode);
request_data.put("to", to_no);
request_data.put("body", sms_message);
// calling message360 api using the given parameters
resp = postUrl(apiurl, request_data, headers, false);
// you can use resp_status for failure handling
resp_status = resp.get("responseCode");
info resp_status;
}
If you have any questions, please post them on the comments section below.