source/Application/Controller/AccountNewsletterController.php
public function subscribe()
    {
        if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
            return false;
        }

        // is logged in ?
        $oUser = $this->getUser();
        if (!$oUser) {
            return false;
        }

        $iStatus = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('status');
        if ($oUser->setNewsSubscription($iStatus, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOrderOptInEmail'))) {
            $this->_iSubscriptionStatus = ($iStatus == 0 && $iStatus !== null) ? -1 : 1;
        }
    }
public function subscribe()
    {
        if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
            return false;
        }

        // is logged in ?
        $oUser = $this->getUser();
        if (!$oUser) {
            return false;
        }

        $iStatus = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('status');
        if ($oUser->setNewsSubscription($iStatus, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOrderOptInEmail'))) {
            $this->_iSubscriptionStatus = ($iStatus == 0 && $iStatus !== null) ? -1 : 1;
        }
    }
public function subscribe ( ) { if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> checkSessionChallenge ( ) ) { return false ; } // is logged in ? $ oUser = $ this -> getUser ( ) ; if ( ! $ oUser ) { return false ; } $ iStatus = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'status' ) ; if ( $ oUser -> setNewsSubscription ( $ iStatus , \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blOrderOptInEmail' ) ) ) { $ this -> _iSubscriptionStatus = ( $ iStatus == 0 && $ iStatus !== null ) ? - 1 : 1 ; } }
Removes or adds user to newsletter group according to
current subscription status. Returns true on success.

@return bool
Removes or adds user to newsletter group according to current subscription status . Returns true on success .