How to tag a user within a message via API
How can we tag a user within an automated message when posting to a channel from within the CRM via custom function
Scenario
We have accounts who get put on credit hold when they don't pay. When we do this it triggers a custom function to post a message to a channel. I'm trying to tag the account owner within the message so it's directed specifically to them.
I'm unable to find it within the API documentation.
My Code Snippet is below...
- //Invoke the user connector function and assign the the map "mp"
- resp = zoho.crm.invokeConnector("crm.getusers",mp);
- respMap = resp.get("response").toMap();
- users = respMap.get("users");
- userList = users.toJSONList();
- ownerList = List();
- userMap = Map();
- for each user in userList
- {
- eachUser = user.toMap();
- if(eachUser.containValue(ownerName))
- {
- ownerList.add(eachUser.get("email"));
- userMap.put("email",eachUser.get("email"));
- userMap.put("channelName",eachUser.get("Sales_Channel_API"));
- ownerEmail = eachUser.get("email");
- }
- }
- info userMap;
- repMessage = "@" + ownerName + " any update on this Account payment? \n\n";
- repChannel = userMap.get("channelName");
- //View Account Url
- url = "https://crm.zoho.com/crm/orgXXXXX/tab/Accounts/" + id;
- title = "Credit Hold Notice For";
- subj = accName;
- body = repMessage + "This account (& any child accounts) are on credit hold. \n\nNo orders will be shipped for this account.";
- payload = {"text":subj,"bot":{"name":"Accounts Dept"},"card":{"title":title,"theme":"modern-inline"},"buttons":{{"label":"View Account","action":{"type":"open.url","data":{"web":url}},"type":"+"}},"slides":{{"type":"text","title":"----------","data":body}}};
- resp = zoho.cliq.postToChannelAsAdmin(repChannel,payload,"zcliq2");
Thanks in advance