src/Service/Emailer.php
public function unsubscribeUser($user_id, $type)
    {
        if ($this->userHasUnsubscribed($user_id, $type)) {
            return true;
        }

        // --------------------------------------------------------------------------

        $oDb = Factory::service('Database');
        $oDb->set('user_id', $user_id);
        $oDb->set('type', $type);
        $oDb->set('created', 'NOW()', false);
        $oDb->insert(NAILS_DB_PREFIX . 'user_email_blocker');

        return (bool) $oDb->affected_rows();
    }
public function unsubscribeUser($user_id, $type)
    {
        if ($this->userHasUnsubscribed($user_id, $type)) {
            return true;
        }

        // --------------------------------------------------------------------------

        $oDb = Factory::service('Database');
        $oDb->set('user_id', $user_id);
        $oDb->set('type', $type);
        $oDb->set('created', 'NOW()', false);
        $oDb->insert(NAILS_DB_PREFIX . 'user_email_blocker');

        return (bool) $oDb->affected_rows();
    }
public function unsubscribeUser ( $ user_id , $ type ) { if ( $ this -> userHasUnsubscribed ( $ user_id , $ type ) ) { return true ; } // -------------------------------------------------------------------------- $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> set ( 'user_id' , $ user_id ) ; $ oDb -> set ( 'type' , $ type ) ; $ oDb -> set ( 'created' , 'NOW()' , false ) ; $ oDb -> insert ( NAILS_DB_PREFIX . 'user_email_blocker' ) ; return ( bool ) $ oDb -> affected_rows ( ) ; }
Unsubscribes a user from a particular email type

@param  int    $user_id The user ID to unsubscribe
@param  string $type    The type of email to unsubscribe from

@return boolean
@throws \Nails\Common\Exception\FactoryException
Unsubscribes a user from a particular email type