Skip to content
Snippets Groups Projects
Commit 4ee58929 authored by Renato Becker's avatar Renato Becker
Browse files

Support for agent's phone field added

parent 0b20d479
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,9 @@ Template.messages.helpers({
agentData.email = agent.emails[0].address;
}
if (agent.customFields && agent.customFields.phone) {
if (agent.phone && agent.phone.length > 0) {
agentData.phone = agent.phone[0].phoneNumber;
} else if (agent.customFields && agent.customFields.phone) {
agentData.phone = agent.customFields.phone;
}
......
......@@ -167,6 +167,7 @@ RocketChat.models.Users.getAgentInfo = function(agentId) {
fields: {
name: 1,
username: 1,
phone: 1,
customFields: 1
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment