When calling MVC controller action from twilio API view is not rendering. But when calling same controller action method from browser, view is loading properly.
I have updated controller action URL in Twilio webhook to call the controller action method.
public ActionResult ReceiveWhatsApp(SmsRequest incomingMessage)
{
WhatsAppTo = incomingMessage.From;
msg = incomingMessage.Body;
ViewBag.JavaScriptFunction = string.Format("Display('{0}');", msg);
return View("Index");
}
function Display(msg) {
var conversationDiv = document.getElementById('conversation');
var requestPara = document.createEle`enter code here`ment("P");
requestPara.className = 'userRequest';
requestPara.appendChild(document.createTextNode(msg));
requestPara.appendChild(requestPara);
conversationDiv.scrollTop = conversationDiv.scrollHeight;
};
I want the end user's message to be display to the agent's view i.e. message window. But when the end user sending some message it's not being displayed to the agent's message window.