public function SendShopReviewMail($aOrder)
    {
        $bMailWasSend = false;

        $oUser = TdbDataExtranetUser::GetNewInstance();
        $oUser->Load($aOrder['data_extranet_user_id']);

        if ($this->AllowSendingMailForOrder($oUser, $aOrder)) {
            $oRatingService = $this->GetSuitableRatingService($oUser, $aOrder);
            if (null !== $oRatingService) {
                $bMailWasSend = $oRatingService->SendShopRatingEmail($oUser, $aOrder);
                if ($bMailWasSend) {
                    $query = "UPDATE `shop_order` SET `pkg_shop_rating_service_mail_sent` = '1', `pkg_shop_rating_service_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($oRatingService->id)."' WHERE `id` = '".MySqlLegacySupport::getInstance()->real_escape_string($aOrder['id'])."'";
                    MySqlLegacySupport::getInstance()->query($query);
                    if (false == $this->bDisableSentHistory) {
                        $sNewID = TTools::GetUUID();
                        $iSendDate = date('Y-m-d H:i:s');
                        $query = "INSERT INTO `pkg_shop_rating_service_history`
                               SET `id` = '".MySqlLegacySupport::getInstance()->real_escape_string($sNewID)."',
                                   `data_extranet_user_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($oUser->id)."',
                                   `shop_order_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($aOrder['id'])."',
                                   `date` = '".MySqlLegacySupport::getInstance()->real_escape_string($iSendDate)."',
                                   `pkg_shop_rating_service_id_list` = '".MySqlLegacySupport::getInstance()->real_escape_string($oRatingService->id)."'
                           ";
                        if ($this->bDebug) {
                            echo __LINE__.': '.$query."\n<br />\n";
                        }
                        MySqlLegacySupport::getInstance()->query($query);
                    }
                }
            }
        }

        return $bMailWasSend;
    }