/** * Get the data */ private function getData() { // get the record $this->record = (array) BackendMailmotorModel::getAddress($this->email); // no item found, throw an exceptions, because somebody is f*****g with our URL if (empty($this->record)) { $this->redirect(BackendModel::createURLForAction('Addresses') . '&error=non-existing'); } // get subscriptions (key/pair values) $this->subscriptions = BackendMailmotorModel::getGroupsByEmailAsPairs($this->email); // the allowed groups $allowedGroups = array_keys($this->subscriptions); // set the passed group ID $this->id = \SpoonFilter::getGetValue('group_id', $allowedGroups, key($this->subscriptions), 'int'); // get group record $this->group = BackendMailmotorModel::getGroup($this->id); }
/** * Export addresses */ private function exportAddresses() { // fetch the creationdate for the addresses foreach ($this->emails as &$email) { $address = BackendMailmotorModel::getAddress($email); $email = array('email' => $email, 'created_on' => strtotime($address['created_on'])); } // export the addresses BackendMailmotorModel::exportAddresses($this->emails); }