//Twilio Info:
tNumber = "<your Twilio phone number>";
acc_sid = "<your Twilio accound Id>";
auth_token = "<your Twilio auth token>";
//Get Lead Details
leadDet= zoho.crm.getRecordById("Leads",leadId.toLong());
//Get Lead's Name
fname = ifnull(zoho.crm.getRecordById("Leads",leadId).get("First_Name"),"");
lname = ifnull(zoho.crm.getRecordById("Leads",leadId).get("Last_Name"),"");
leadName = fname + " " + lname;
info "Lead Name: " + leadName;
//Determine recipient number
leadPhone = ifnull(leadDet.get("Mobile"),"");
// info leadPhone;
if(leadPhone != "")
{
mess = "<Enter your message here>";
info mess;
//preparing authorization parameters
auth = acc_sid + ":" + auth_token;
base = zoho.encryption.base64Encode(auth);
base = base.remove("\n");
//posting SMS
mp = Map();
mp.put("To",leadPhone.toString());
mp.put("From",tNumber);
mp.put("Body",mess);
hMap = Map();
hMap.put("Authorization","Basic " + base);
postv = postUrl(url,mp,hMap);
info postv;
}
else
{
info "Lead mobile is empty";
}