public function _active()
 {
     $id = abs((int) $_GET['id']);
     if (!$id) {
         return;
     }
     $subscriber = new EmailSubscriberEntity($id);
     $subscriber->flipBoolValue('active');
     $subscriber->save();
     App::add('Email Subscriber with email  "' . $subscriber->getEmail() . '" ' . ($subscriber->getActive() ? '' : 'de') . 'activated');
     Messages::sendMessage('Subscriber ' . ($subscriber->getActive() ? '' : 'de') . 'activated');
     if (IS_AJAX_REQUEST) {
         die('1');
     }
     back();
 }
 /**
  * @param $email
  * @param array $additional_data
  * @return bool
  */
 public static function addNewEmailSubscriber($email, array $additional_data = [])
 {
     // Check email
     if (!Verify::email($email)) {
         return false;
     }
     // Set supplied email
     $subscriber = new EmailSubscriberEntity();
     $subscriber->setEmail($email);
     // Set any supplied data
     if ($additional_data) {
         $subscriber->loadDataFromArray($additional_data);
     }
     // Create subscriber
     $subscriber->save();
     return true;
 }