unsubscribeByToken() public method

public unsubscribeByToken ( string $token ) : boolean
$token string
return boolean
 public function unsubscribeAction()
 {
     $this->enableLayout();
     $newsletter = new Newsletter("person");
     // replace "crm" with the class name you have used for your class above (mailing list)
     $unsubscribeMethod = null;
     $success = false;
     if ($this->getParam("email")) {
         $unsubscribeMethod = "email";
         $success = $newsletter->unsubscribeByEmail($this->getParam("email"));
     }
     if ($this->getParam("token")) {
         $unsubscribeMethod = "token";
         $success = $newsletter->unsubscribeByToken($this->getParam("token"));
     }
     $this->view->success = $success;
     $this->view->unsubscribeMethod = $unsubscribeMethod;
 }