示例#1
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the GetResponse API.
     if (!class_exists('GetResponse_OM')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/getresponse/getresponse.php';
     }
 }
示例#2
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the AWeber API.
     if (!class_exists('AWeberAPI')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/aweber/aweber_api.php';
     }
 }
示例#3
0
文件: emma.php 项目: venturepact/blog
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the Emma API.
     if (!class_exists('Emma')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/emma/Emma.php';
     }
 }
示例#4
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the iContact API.
     if (!class_exists('iContactApi')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/icontact/iContactApi.php';
     }
 }
示例#5
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the InfusionSoft API.
     if (!class_exists('iSDK')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/infusionsoft/isdk.php';
     }
 }
示例#6
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the MailChimp API.
     if (!class_exists('OM_Mailchimp')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/mailchimp/mailchimp.php';
     }
 }
示例#7
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the TotalSend API.
     if (!class_exists('TotalSend')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/totalsend/totalsend.php';
     }
 }
示例#8
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the Mad Mimi API.
     if (!class_exists('MadMimi')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/madmimi/madmimi.php';
     }
 }
示例#9
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the SendinBlue API.
     if (!class_exists('Mailin')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/sendinblue/mailin.php';
     }
 }
示例#10
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the ActiveCampaign API.
     if (!class_exists('ActiveCampaign')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/activecampaign/ActiveCampaign.class.php';
     }
 }
示例#11
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the Pardot API Wrapper.
     if (!class_exists('Pardot_OM_API')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/pardot/pardot.php';
     }
 }
示例#12
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the HubSpot API.
     if (!class_exists('HubSpot_Lists')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/hubspot/class.lists.php';
         require plugin_dir_path($this->base->file) . 'includes/vendor/hubspot/class.leads.php';
         require plugin_dir_path($this->base->file) . 'includes/vendor/hubspot/class.contacts.php';
     }
 }
示例#13
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the Campaign Monitor API.
     if (!class_exists('CS_REST_General')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/campaign-monitor/csrest_general.php';
         require plugin_dir_path($this->base->file) . 'includes/vendor/campaign-monitor/csrest_clients.php';
         require plugin_dir_path($this->base->file) . 'includes/vendor/campaign-monitor/csrest_lists.php';
         require plugin_dir_path($this->base->file) . 'includes/vendor/campaign-monitor/csrest_subscribers.php';
     }
 }
示例#14
0
 /**
  * Primary class constructor.
  *
  * @since 2.1.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
     // Load the MailerLite API.
     if (!class_exists('ML_Lists')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/mailerlite/ML_Lists.php';
     }
     if (!class_exists('ML_Subscribers')) {
         require plugin_dir_path($this->base->file) . 'includes/vendor/mailerlite/ML_Subscribers.php';
     }
 }
示例#15
0
 /**
  * Primary class constructor.
  *
  * @since 2.0.0
  */
 public function __construct()
 {
     // Construct via the parent object.
     parent::__construct();
 }
示例#16
0
 /**
  * The class constructor.
  *
  * @since 2.0.0
  *
  * @param                               $data        The user data from the browser
  * @param Optin_Monster_Provider        $provider    The provider object
  * @param Optin_Monster_Lead_Datastore  $lead_store  The lead datastore object
  * @param Optin_Monster_Track_Datastore $track_store The tracking datastore object
  */
 public function __construct($data, Optin_Monster_Provider $provider, Optin_Monster_Lead_Datastore $lead_store, Optin_Monster_Track_Datastore $track_store)
 {
     // Set class properties.
     $this->provider = $provider;
     $this->lead_store = $lead_store;
     $this->track_store = $track_store;
     // Process the data from the browser.
     $lead['optin_id'] = isset($data['optin_id']) ? absint($data['optin_id']) : 0;
     $lead['referrer'] = isset($data['referrer']) ? stripslashes(esc_url($data['referrer'])) : '';
     $lead['user_agent'] = isset($data['user_agent']) ? stripslashes(strip_tags($data['user_agent'])) : '';
     $lead['lead_name'] = isset($data['name']) ? stripslashes($data['name']) : '';
     $lead['lead_email'] = isset($data['email']) ? stripslashes($data['email']) : '';
     $lead['referred_from'] = isset($data['previous']) ? stripslashes(esc_url($data['previous'])) : '';
     $lead['post_id'] = isset($data['post_id']) ? absint($data['post_id']) : 0;
     $lead['lead_type'] = 'conversion';
     // Get the optin meta data.
     $this->optin_meta = get_post_meta($lead['optin_id'], '_om_meta', true);
     // Provide a hook to save custom tracking data.
     do_action('optin_monster_track_optin', $lead['optin_id'], 'conversion');
     // Increase the conversion counter.
     if (apply_filters('optin_monster_tracking', true, $lead['optin_id'])) {
         try {
             $track = $this->track_store->save('conversion');
         } catch (Exception $e) {
             $this->response = $e->getMessage();
         }
     }
     // Save the lead in the database.
     $option = get_option('optin_monster');
     if (isset($option['leads']) && $option['leads']) {
         try {
             $save = $this->lead_store->save($lead);
         } catch (Exception $e) {
             $this->response = $e->getMessage();
         }
     }
     // Save the lead to the email provider.
     $providers = Optin_Monster_Common::get_instance()->get_email_providers(true);
     $provider = $this->optin_meta['email']['provider'];
     $account = $this->optin_meta['email']['account'];
     $list_id = $this->optin_meta['email']['list_id'];
     // Prepare the provider account.
     $provider_account = $providers[$provider][$account];
     $provider_account['account_id'] = $account;
     // Get segments if set.
     if (!empty($this->optin_meta['email']['segments'])) {
         $provider_account['segments'] = $this->optin_meta['email']['segments'];
     }
     // Get client if set.
     if (!empty($this->optin_meta['email']['client_id'])) {
         $provider_account['client'] = $this->optin_meta['email']['client_id'];
     }
     // Set the response.
     $this->response = $this->provider->optin($provider_account, $list_id, $lead);
     // Provide a hook to interact with the lead.
     do_action('optin_monster_after_lead_stored', $lead, $this);
     // Allow the response to be filtered (as long as it is not an error) so that lead data can be passed back to redirect URLs.
     if (!is_wp_error($this->response)) {
         $this->response = apply_filters('optin_monster_lead_response', $this->response, $lead, $this);
     }
 }