Hi,
It is possible to send to a Custom Field in Omnichannel using the Twilio integration, sending in the payload as shown below:
SMS Payload:
New field “CrmID”:
{
"CrmID": "2020220",
"From": "5551123456789",
"To": "5551987654321",
"Body": "SMS message",
"ToCountry": "Brazil",
"ToState": "RS",
"ToCity": "Porto Alegre",
"ToZip": "",
"FromCountry": "Brazil",
"FromState": "RS",
"FromCity": "Porto Alegre",
"FromZip": ""
}
According to the line of code below, the extra options such as lat, long, ToState, FromCountry should be embedded in Custom Fields, but this does not happen.
attachment.audio_url = curr.url;
break;
}
return attachment;
});
try {
const message = SMSService.response.call(this, Promise.await(Livechat.sendMessage(sendMessage)));
Meteor.defer(() => {
if (sms.extra) {
if (sms.extra.fromCountry) {
Meteor.call('livechat:setCustomField', sendMessage.message.token, 'country', sms.extra.fromCountry);
}
if (sms.extra.fromState) {
Meteor.call('livechat:setCustomField', sendMessage.message.token, 'state', sms.extra.fromState);
}
if (sms.extra.fromCity) {
Meteor.call('livechat:setCustomField', sendMessage.message.token, 'city', sms.extra.fromCity);
}
After the inclusion of Custom Fields, country, city and state in the Omnichannel part, the parameters started to be forwarded to Custom Fields:
1 Like
bmwas
January 13, 2021, 4:14am
3
Hello,
Thank you for sharing this … have you tried to add more custom fields? (e.g. neighborhood). I know this is largely used for twilio but I wanted to add that information on the payload as well.