Exemple #1
0
 /**
  * Gets the Newsletter entries.
  *
  * @param array $where
  * @return NewsletterModel[]|array
  */
 public function getMail()
 {
     $entryArray = $this->db()->select('*')->from('newsletter_mails')->execute()->fetchRows();
     if (empty($entryArray)) {
         return null;
     }
     $entry = array();
     foreach ($entryArray as $entries) {
         $entryModel = new NewsletterModel();
         $entryModel->setEmail($entries['email']);
         $entry[] = $entryModel;
     }
     return $entry;
 }
Exemple #2
0
 public function indexAction()
 {
     $newsletterMapper = new NewsletterMapper();
     $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('settings'), array('action' => 'index'));
     if ($this->getRequest()->isPost()) {
         $newsletterModel = new NewsletterModel();
         foreach ($this->getRequest()->getPost('check_users') as $userEmail) {
             if ($userEmail != '') {
                 $newsletterModel->setEmail($userEmail);
                 $newsletterMapper->saveEmail($newsletterModel);
                 //$newsletterMapper->activeEmail($newsletterModel);
             }
         }
         $this->addMessage('saveSuccess');
     }
     $emails = $newsletterMapper->getMail();
     $this->getView()->set('emails', $emails);
     $userList = $newsletterMapper->getSendMailUser();
     $this->getView()->set('userList', $userList);
 }