function get_current_module()
 {
     $current_module = aem_get_option('eam_current_service', 0);
     $modules = $this->get_module_names();
     if (isset($modules[$current_module])) {
         return $this->get_module($modules[$current_module]);
     } else {
         return FALSE;
     }
 }
 function check_option()
 {
     $sessions = $this->get_setting_section();
     $groups = $sessions['groups'];
     foreach ($groups as $group) {
         foreach ($group["fields"] as $field) {
             if (isset($field['required']) && $field['required'] == true) {
                 $field_value = aem_get_option($field['name'], FALSE);
                 if ($field_value == FALSE) {
                     return FALSE;
                 }
             }
         }
     }
     return TRUE;
 }
 /**
  * Get mailgun client
  *
  * @return AEM_Module_Mailgun_Client
  */
 function get_client()
 {
     if (is_null($this->client)) {
         $apiKey = aem_get_option('mailgun_apiKey');
         $apiDomain = aem_get_option('mailgun_domain');
         //check apikey
         if (FALSE == $apiKey) {
             return new WP_Error("mailgun_api_missing", "Please enter Mailgun API to using Mailgun service.");
         }
         //check
         if (FALSE == $apiDomain) {
             return new WP_Error("mailgun_domain_missing", "Please enter Mailgun domain to using Mailgun service.");
         }
         $this->client = new AEM_Module_Mailgun_Client($apiKey, $apiDomain);
     }
     return $this->client;
 }
 /**
  * Get mandrill client
  *
  * @return AEM_Module_mandrill_Client
  */
 function get_client()
 {
     if (is_null($this->client)) {
         $apiKey = aem_get_option('mandrill_apiKey');
         //check apikey
         if (FALSE == $apiKey) {
             return new WP_Error("mandrill_api_missing", "Please enter mandrill API to using mandrill service.");
         }
         $this->client = new AEM_Module_Mandrill_Client($apiKey);
     }
     return $this->client;
 }
 public function is_open_tracking()
 {
     $is_click_tracking = aem_get_option('aem_open_tracking', FALSE);
     return apply_filters("aem_open_tracking", $is_click_tracking);
 }
 /**
  * Get sendgrid client
  *
  * @return AEM_Module_sendgrid_Client
  */
 function get_client()
 {
     if (is_null($this->client)) {
         $username = aem_get_option('sendgrid_username');
         $password = aem_get_option('sendgrid_password');
         //check apikey
         if (FALSE == $username) {
             return new WP_Error("sendgrid_username_missing", "Please enter sendgrid username to using sendgrid service.");
         }
         if (FALSE == $password) {
             return new WP_Error("sendgrid_password_missing", "Please enter sendgrid password to using sendgrid service.");
         }
         $this->client = new AEM_Module_Sendgrid_Client($username, $password);
     }
     return $this->client;
 }