public function invalidate($id, $account) { $user = new User($id); $uinfo = $user->get(); $user->modify(array('_id' => $user->id), array('$addToSet' => array('social_invalidated' => $account))); $recipients = array($id); $this->add(array('sender' => $id, 'recipients' => $recipients, 'text' => $this->_body($this->_prefix . __FUNCTION__ . '.php', array('social' => $this->_social_account($account))), 'type' => $this->_prefix . __FUNCTION__, 'url' => Url::base('influencer/social'))); $this->mail_enqueue(array('to' => $uinfo['email'], 'from' => $this->_from_email, 'subject' => 'Social Account Invalidated', 'message' => $this->_mail_body($this->_prefix . __FUNCTION__ . '.php', array('user' => $uinfo, 'social' => $this->_social_account($account))))); }