private function getContextlyBaseUrl($page_type)
 {
     $url_params = array('type' => $page_type, 'blog_url' => site_url(), 'blog_title' => get_bloginfo("name"), 'cms_settings_page' => $this->getWPPluginSettingsUrl());
     // Get MAJOR.MINOR version for the Control Panel.
     $version = ContextlyWpKit::getInstance()->version();
     $verison_parsed = ContextlyWpKit::parseVersion($version);
     if ($verison_parsed) {
         $url_params['kit_version'] = $verison_parsed[0] . '.' . $verison_parsed[1];
     }
     return Urls::getMainServerUrl() . 'cms-redirect/?' . http_build_query($url_params, NULL, '&');
 }
 public static function getMainServerUrl()
 {
     return ContextlyWpKit::getInstance()->getServerUrl('cp');
 }
 public static function fireAPIEvent($type, $text = '')
 {
     $api = ContextlyWpKit::getInstance()->newApi();
     try {
         $api->method('events', 'put')->extraParams(array('event_type' => 'email', 'event_name' => $type, 'site_path' => site_url(), 'event_message' => $text))->get();
     } catch (Exception $e) {
     }
 }