/*---------------------------------- Fetch all Customer Service Agent email ----------------------------------*/ userEmail = ""; userMobile = ""; UserRespList = zoho.fsm.getRecords("users").get("users").toList(); for each UserResp in UserRespList { UserRespMap = UserResp.toMap(); if(UserRespMap.get("client_profile") == "Customer Service Agent") { userEmailTemp = UserRespMap.get("email"); userEmail = userEmail + "," + userEmailTemp; } if(UserRespMap.get("client_profile") == "Administrator") { userMobile = UserRespMap.get("mobile"); } } if(userEmail != "") { userEmail = userEmail.subString(1,userEmail.length()); } /*---------------------------------- Fetch Request Detail ----------------------------------*/ requestId = request.get("id"); requestResp = zoho.fsm.getRecordById("Requests",requestId); requestData = requestResp.get("data").toMap(); Name = requestData.get("Summary"); id = requestData.get("id"); Phone = requestData.get("Phone"); Email = requestData.get("Email"); Priority = requestData.get("Priority"); Contact = requestData.get("Contact").toMap().get("name"); /*---------------------------------- construct message ----------------------------------*/ message = "Dear Customer Service Agents,<br><br> A new request has been added to FSM. Details are as follows: <br><br> Request Summary - " + Name + ", <br>Priority - " + Priority + ", <br>Customer name - " + Contact + ",<br> Customer Email - " + Email + ",<br> Customer Phone - " + Phone + ",<br> FSM Link - https://fsm.zoho.com/home#/tab/Requests/" + id + "<br><br>Kindly check the request and do the needful. <br><br>Thanks & Regard,<br>Admin"; /*---------------------------------- Send Mail ----------------------------------*/ sendmail [ from :zoho.adminuserid to :userEmail subject :"New Request received in FSM" message :message ] /*---------------------------------- Send SMS ----------------------------------*/ bodymap = Map(); bodymap.put("To",userMobile); bodymap.put("From","+15139958354"); bodymap.put("Body",message); //Replace {AccountSid} with actual value sms_response = invokeurl [ type :POST parameters:bodymap connection:"twilio" ]; info sms_response; |
Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.
If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.
You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.