src/ShopOrderStatusBundle/objects/TPkgShopOrderStatusManagerEndPoint.class.php
protected function sendStatusMailToCustomerWithFrontEndAction(TdbShopOrderStatus $oStatus)
    {
        $bSuccess = false;
        $sPortalId = null;
        $oOrder = $oStatus->GetFieldShopOrder();
        if (!is_null($oOrder) && '' != $oOrder->fieldCmsPortalId) {
            $sPortalId = $oOrder->fieldCmsPortalId;
        }
        $oAction = TdbPkgRunFrontendAction::CreateAction(
            'TPkgRunFrontendAction_SendOrderStatusEMail',
            $sPortalId,
            array('order_status_id' => $oStatus->id, 'order_id' => $oStatus->fieldShopOrderId)
        );
        $sURL = $oAction->getUrlToRunAction();
        $sURL = str_replace('&amp;', '&', $sURL); // remove encoding
        $oToHostHandler = new TPkgCmsCoreSendToHost();
        $oToHostHandler->setConfigFromUrl($sURL);
        $this->getShopLogger()->info(sprintf('sending mail via frontend action using URL: %s', $sURL));
        $executeRequestResponse = $oToHostHandler->executeRequest();
        if (preg_match('#{.*}#', $executeRequestResponse, $aMatches)) {
            $this->getShopLogger()->info('done sending mail via frontend action. got response ', array('response' => $aMatches[0]));
            $aResponse = json_decode($aMatches[0], true);
            if (is_array($aResponse) && count(
                $aResponse
            ) > 0 && isset($aResponse['sMessageType']) && 'MESSAGE' == $aResponse['sMessageType']
            ) {
                $bSuccess = true;
            }
        } else {
            $this->getShopLogger()->error('failed sending mail via frontend action. got response', array('response' => $executeRequestResponse));
        }

        return $bSuccess;
    }
protected function sendStatusMailToCustomerWithFrontEndAction(TdbShopOrderStatus $oStatus)
    {
        $bSuccess = false;
        $sPortalId = null;
        $oOrder = $oStatus->GetFieldShopOrder();
        if (!is_null($oOrder) && '' != $oOrder->fieldCmsPortalId) {
            $sPortalId = $oOrder->fieldCmsPortalId;
        }
        $oAction = TdbPkgRunFrontendAction::CreateAction(
            'TPkgRunFrontendAction_SendOrderStatusEMail',
            $sPortalId,
            array('order_status_id' => $oStatus->id, 'order_id' => $oStatus->fieldShopOrderId)
        );
        $sURL = $oAction->getUrlToRunAction();
        $sURL = str_replace('&amp;', '&', $sURL); // remove encoding
        $oToHostHandler = new TPkgCmsCoreSendToHost();
        $oToHostHandler->setConfigFromUrl($sURL);
        $this->getShopLogger()->info(sprintf('sending mail via frontend action using URL: %s', $sURL));
        $executeRequestResponse = $oToHostHandler->executeRequest();
        if (preg_match('#{.*}#', $executeRequestResponse, $aMatches)) {
            $this->getShopLogger()->info('done sending mail via frontend action. got response ', array('response' => $aMatches[0]));
            $aResponse = json_decode($aMatches[0], true);
            if (is_array($aResponse) && count(
                $aResponse
            ) > 0 && isset($aResponse['sMessageType']) && 'MESSAGE' == $aResponse['sMessageType']
            ) {
                $bSuccess = true;
            }
        } else {
            $this->getShopLogger()->error('failed sending mail via frontend action. got response', array('response' => $executeRequestResponse));
        }

        return $bSuccess;
    }
protected function sendStatusMailToCustomerWithFrontEndAction ( TdbShopOrderStatus $ oStatus ) { $ bSuccess = false ; $ sPortalId = null ; $ oOrder = $ oStatus -> GetFieldShopOrder ( ) ; if ( ! is_null ( $ oOrder ) && '' != $ oOrder -> fieldCmsPortalId ) { $ sPortalId = $ oOrder -> fieldCmsPortalId ; } $ oAction = TdbPkgRunFrontendAction :: CreateAction ( 'TPkgRunFrontendAction_SendOrderStatusEMail' , $ sPortalId , array ( 'order_status_id' => $ oStatus -> id , 'order_id' => $ oStatus -> fieldShopOrderId ) ) ; $ sURL = $ oAction -> getUrlToRunAction ( ) ; $ sURL = str_replace ( '&amp;' , '&' , $ sURL ) ; // remove encoding $ oToHostHandler = new TPkgCmsCoreSendToHost ( ) ; $ oToHostHandler -> setConfigFromUrl ( $ sURL ) ; $ this -> getShopLogger ( ) -> info ( sprintf ( 'sending mail via frontend action using URL: %s' , $ sURL ) ) ; $ executeRequestResponse = $ oToHostHandler -> executeRequest ( ) ; if ( preg_match ( '#{.*}#' , $ executeRequestResponse , $ aMatches ) ) { $ this -> getShopLogger ( ) -> info ( 'done sending mail via frontend action. got response ' , array ( 'response' => $ aMatches [ 0 ] ) ) ; $ aResponse = json_decode ( $ aMatches [ 0 ] , true ) ; if ( is_array ( $ aResponse ) && count ( $ aResponse ) > 0 && isset ( $ aResponse [ 'sMessageType' ] ) && 'MESSAGE' == $ aResponse [ 'sMessageType' ] ) { $ bSuccess = true ; } } else { $ this -> getShopLogger ( ) -> error ( 'failed sending mail via frontend action. got response' , array ( 'response' => $ executeRequestResponse ) ) ; } return $ bSuccess ; }
send status mail simulating a front end action to use twig templates from customer.

@param TdbShopOrderStatus $oStatus

@return bool
send status mail simulating a front end action to use twig templates from customer .