Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
blopa committed Dec 24, 2017
1 parent 0d97f2d commit eefc390
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ public function execute()
{
$chatbotUser = $this->_helper->getChatbotuserBySenderId($message->getSenderId());
if ($chatbotUser->getEnablePromotionalMessages() == $this->_define::DISABLED)
{
$this->_helper->logger(__("Customer ID %1 choose to not receive promotional messages.", $chatbotUser->getCustomerId()), 'werules_chatbot_promotional_messages.log');
continue;
}

$content = array(
'content_type' => $this->_define::CONTENT_TEXT,
Expand All @@ -90,6 +93,8 @@ public function execute()
$promotionalMessage->save();
}
}
else
$this->_helper->logger(__("Unable to send message to Chatbot Chat ID %1.", $message->getSenderId()), 'werules_chatbot_promotional_messages.log');
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Magento2/app/code/Werules/Chatbot/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,5 @@
"Contains","Contains"
"Match RegEx","Match RegEx"
"Option Text","Option Text"
"Customer ID %1 choose to not receive promotional messages.","Customer ID %1 choose to not receive promotional messages."
"Unable to send message to Chatbot Chat ID %1.","Unable to send message to Chatbot Chat ID %1."

0 comments on commit eefc390

Please sign in to comment.