src/ShopRatingServiceBundle/objects/cronjobs/TPkgShopRating_CronJob_SendRatingMails.class.php
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;
    }
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;
    }
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 ; }
send the shop review mail and log the action in es_shop_review
returns true if the mail was send. note that the method checks if the customer is allowed
to receiven a mail for the given order.

@param array $aOrder - the order data

@return bool
send the shop review mail and log the action in es_shop_review returns true if the mail was send . note that the method checks if the customer is allowed to receiven a mail for the given order .