38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?php
|
|
|
|
// namespace App\Conversations;
|
|
namespace App\Controllers\Chatbot;
|
|
|
|
use BotMan\BotMan\Messages\Conversations\Conversation;
|
|
use BotMan\BotMan\Messages\Outgoing\Question;
|
|
use BotMan\BotMan\Messages\Outgoing\Actions\Button;
|
|
|
|
use App\Helpers\ChatbotHelper;
|
|
|
|
class ReimbursementClaimProcessConversation extends Conversation
|
|
{
|
|
public function run()
|
|
{
|
|
$this->bot->types(); // Typing indicator for the first message
|
|
sleep(0.5); // Delay
|
|
$this->claimProcess();
|
|
}
|
|
|
|
protected function claimProcess()
|
|
{
|
|
$chat_session_info = get_chatbot_session_info();
|
|
$res = ChatbotHelper::sendReimbursementProcessOverMail($chat_session_info);
|
|
if($res == true)
|
|
{
|
|
$this->say("Reimbursement process shared over your registered mail...!");
|
|
}
|
|
else
|
|
{
|
|
$this->say("No email found in your profile / Please contact support team");
|
|
}
|
|
|
|
$this->bot->startConversation(new doYouWantToContinueConversation());
|
|
|
|
}
|
|
}
|