FIX_CHATBOT_TKT_216

This commit is contained in:
velz 2025-09-11 09:34:18 +05:30
parent 4620104e0a
commit f3b8f735fc
3 changed files with 26 additions and 9 deletions

View File

@ -24,10 +24,19 @@ class ReimbursementClaimStatusConversation extends Conversation
$chat_session_info = get_chatbot_session_info();
$data = ChatbotHelper::getReimbursementClaimStatus($chat_session_info);
log_message('error','Claim Number - ' . json_encode($data['claim_number']));
$this->bot->types();
if ($data){
$this->say("The claim status for the claim Number {$data['claim_number']} is currently in <strong>{$data['client_status']}</strong> status. <br> More Detailed Information is sent to your mail");
if(isset($data['claim_number']) && $data['claim_number'] !== null)
{
log_message('error','Claim Number YES- ' . json_encode($data['claim_number']));
$this->say("The claim status for the claim Number {$data['claim_number']} is currently in <strong>{$data['client_status']}</strong> status. <br> More Detailed Information is sent to your mail");
}
else
{
log_message('error','Claim Number NO- ' . json_encode($data['claim_number']));
$this->say("The claim status for your latest claim (ID not generated) is currently in <strong>{$data['client_status']}</strong> status. <br> More Detailed Information is sent to your mail");
}
$this->bot->startConversation(new doYouWantToContinueConversation());
}else{
$this->say("No Claim Raised against the user.");

View File

@ -116,7 +116,7 @@ class ChatbotControllerNew extends BaseController
// Start the Main Menu when user says "hi" or "start"
$this->botman->hears('start|hi|hello|help|help me', function (BotMan $bot) {
if ($this->isMemberLoggedIn){
$bot->reply('Hi how can i assist?');
// $bot->reply('Hi how can i assist?');
$bot->startConversation(new MainMenuConversation());
}else {
$bot->startConversation(new LoginToContiueConversation());

View File

@ -570,10 +570,10 @@ function setupMessageObserver() {
if (window.botmanWidget) {
botmanChatWidget.open();
setTimeout(function(){
botmanChatWidget.sayAsBot('Hi ' + (typeof name !== "undefined" && name !== null && name !== "" ? name : "Guest User") + ', This is ILA your Insurance Assistant, plz choose the following options');
botmanChatWidget.whisper('Hi');
}, 1000);
// setTimeout(function(){
// botmanChatWidget.sayAsBot('Hi ' + (typeof name !== "undefined" && name !== null && name !== "" ? name : "Guest User") + ', This is ILA your Insurance Assistant, plz choose the following options');
// botmanChatWidget.whisper('Hi');
// }, 10);
applyBotManChatCSS();
@ -593,6 +593,14 @@ function setupMessageObserver() {
chatFrame.addEventListener("load", () => {
console.log('Iframe loaded event triggered');
setTimeout(() => injectCSS(chatFrame), 100);
// DADA
setTimeout(function(){
botmanChatWidget.sayAsBot('Hi ' + (typeof name !== "undefined" && name !== null && name !== "" ? name : "Guest User") + ', This is ILA your Insurance Assistant, plz choose the following options');
botmanChatWidget.whisper('Hi');
}, 100);
// DADA
});
});
}
@ -677,8 +685,8 @@ function setupMessageObserver() {
</script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>
<script src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/widget.js'></script>