source/Application/Controller/NewsletterController.php
public function removeme()
    {
        // existing user ?
        $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
        if ($oUser->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('uid'))) {
            $oUser->getNewsSubscription()->setOptInStatus(0);

            // removing from group ..
            $oUser->removeFromGroup('oxidnewsletter');

            $this->_iNewsletterStatus = 3;
        }
    }
public function removeme()
    {
        // existing user ?
        $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
        if ($oUser->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('uid'))) {
            $oUser->getNewsSubscription()->setOptInStatus(0);

            // removing from group ..
            $oUser->removeFromGroup('oxidnewsletter');

            $this->_iNewsletterStatus = 3;
        }
    }
public function removeme ( ) { // existing user ? $ oUser = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ User :: class ) ; if ( $ oUser -> load ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'uid' ) ) ) { $ oUser -> getNewsSubscription ( ) -> setOptInStatus ( 0 ) ; // removing from group .. $ oUser -> removeFromGroup ( 'oxidnewsletter' ) ; $ this -> _iNewsletterStatus = 3 ; } }
Loads user and removes him from newsletter group.
Loads user and removes him from newsletter group .