src/ShopArticlePreorderBundle/objects/db/TPkgShopArticlePreorder.class.php
public function SendMail($oArticle = null, $sEmail = '')
    {
        // ------------------------------------------------------------------------
        static $aPortals = array();
        if (null === $oArticle) {
            $oArticle = $this->GetFieldShopArticle();
        }
        if ('' === $sEmail) {
            $sEmail = $this->fieldPreorderUserEmail;
        }
        if (!is_null($oArticle) && !empty($sEmail)) {
            $oMail = TdbDataMailProfile::GetProfile('preorder-available');
            $sArticleDetailLink = $oArticle->GetDetailLink(true);

            if (!array_key_exists($this->fieldCmsPortalId, $aPortals)) {
                $oCMSPortal = TdbCmsPortal::GetNewInstance();
                if ($oCMSPortal->Load($this->fieldCmsPortalId)) {
                    $aPortals[$this->fieldCmsPortalId] = $oCMSPortal;
                }
            }

            $sArticleBasketLink = '';
            if (array_key_exists($this->fieldCmsPortalId, $aPortals)) {
                $sArticleBasketLink = 'http://'.$aPortals[$this->fieldCmsPortalId]->GetPrimaryDomain().'/'.TdbShopArticle::URL_EXTERNAL_TO_BASKET_REQUEST.'/id/'.urlencode($oArticle->id);
            }

            $oMail->AddData('sUserEmail', $sEmail);
            $oMail->AddData('sArticleName', $oArticle->GetName());
            $oMail->AddData('sArticleDetailLink', $sArticleDetailLink);
            $oMail->AddData('sArticleBasketLink', $sArticleBasketLink);

            $oMail->ChangeToAddress($sEmail);
            $oMail->SendUsingObjectView('emails', 'Customer');

            $this->AllowEditByAll(true);
            $this->Delete();
            $this->AllowEditByAll(false);

            return true;
        } else {
            return false;
        }
    }
public function SendMail($oArticle = null, $sEmail = '')
    {
        // ------------------------------------------------------------------------
        static $aPortals = array();
        if (null === $oArticle) {
            $oArticle = $this->GetFieldShopArticle();
        }
        if ('' === $sEmail) {
            $sEmail = $this->fieldPreorderUserEmail;
        }
        if (!is_null($oArticle) && !empty($sEmail)) {
            $oMail = TdbDataMailProfile::GetProfile('preorder-available');
            $sArticleDetailLink = $oArticle->GetDetailLink(true);

            if (!array_key_exists($this->fieldCmsPortalId, $aPortals)) {
                $oCMSPortal = TdbCmsPortal::GetNewInstance();
                if ($oCMSPortal->Load($this->fieldCmsPortalId)) {
                    $aPortals[$this->fieldCmsPortalId] = $oCMSPortal;
                }
            }

            $sArticleBasketLink = '';
            if (array_key_exists($this->fieldCmsPortalId, $aPortals)) {
                $sArticleBasketLink = 'http://'.$aPortals[$this->fieldCmsPortalId]->GetPrimaryDomain().'/'.TdbShopArticle::URL_EXTERNAL_TO_BASKET_REQUEST.'/id/'.urlencode($oArticle->id);
            }

            $oMail->AddData('sUserEmail', $sEmail);
            $oMail->AddData('sArticleName', $oArticle->GetName());
            $oMail->AddData('sArticleDetailLink', $sArticleDetailLink);
            $oMail->AddData('sArticleBasketLink', $sArticleBasketLink);

            $oMail->ChangeToAddress($sEmail);
            $oMail->SendUsingObjectView('emails', 'Customer');

            $this->AllowEditByAll(true);
            $this->Delete();
            $this->AllowEditByAll(false);

            return true;
        } else {
            return false;
        }
    }
public function SendMail ( $ oArticle = null , $ sEmail = '' ) { // ------------------------------------------------------------------------ static $ aPortals = array ( ) ; if ( null === $ oArticle ) { $ oArticle = $ this -> GetFieldShopArticle ( ) ; } if ( '' === $ sEmail ) { $ sEmail = $ this -> fieldPreorderUserEmail ; } if ( ! is_null ( $ oArticle ) && ! empty ( $ sEmail ) ) { $ oMail = TdbDataMailProfile :: GetProfile ( 'preorder-available' ) ; $ sArticleDetailLink = $ oArticle -> GetDetailLink ( true ) ; if ( ! array_key_exists ( $ this -> fieldCmsPortalId , $ aPortals ) ) { $ oCMSPortal = TdbCmsPortal :: GetNewInstance ( ) ; if ( $ oCMSPortal -> Load ( $ this -> fieldCmsPortalId ) ) { $ aPortals [ $ this -> fieldCmsPortalId ] = $ oCMSPortal ; } } $ sArticleBasketLink = '' ; if ( array_key_exists ( $ this -> fieldCmsPortalId , $ aPortals ) ) { $ sArticleBasketLink = 'http://' . $ aPortals [ $ this -> fieldCmsPortalId ] -> GetPrimaryDomain ( ) . '/' . TdbShopArticle :: URL_EXTERNAL_TO_BASKET_REQUEST . '/id/' . urlencode ( $ oArticle -> id ) ; } $ oMail -> AddData ( 'sUserEmail' , $ sEmail ) ; $ oMail -> AddData ( 'sArticleName' , $ oArticle -> GetName ( ) ) ; $ oMail -> AddData ( 'sArticleDetailLink' , $ sArticleDetailLink ) ; $ oMail -> AddData ( 'sArticleBasketLink' , $ sArticleBasketLink ) ; $ oMail -> ChangeToAddress ( $ sEmail ) ; $ oMail -> SendUsingObjectView ( 'emails' , 'Customer' ) ; $ this -> AllowEditByAll ( true ) ; $ this -> Delete ( ) ; $ this -> AllowEditByAll ( false ) ; return true ; } else { return false ; } }
send email to users email for the given article.

@param TShopArticle $oArticle
@param string       $sEmail

@return bool
send email to users email for the given article .