public function activecampaign_subscribe($that, $ar, $wpm_id, $email, $unsub = false) { $options = $that->GetOption('Autoresponders'); $maps = $options['activecampaign']['maps'][$wpm_id]; if (empty($maps)) { return; } $api_url = $options['activecampaign']['api_url']; $api_key = $options['activecampaign']['api_key']; $ac = new WpActiveCampaign($api_url, $api_key); try { if (!empty($maps)) { if ($unsub && $options['activecampaign'][$wpm_id]['autoremove']) { $ac->remove_from_lists($maps, $email); } if (!$unsub) { $ac->add_to_lists($maps, array('first_name' => $that->ARSender['first_name'], 'last_name' => $that->ARSender['last_name'], 'email' => $that->ARSender['email'])); } } } catch (Exception $e) { error_log($e->getMessage()); } }
<?php $__index__ = 'activecampaign'; $__ar_options__[$__index__] = 'ActiveCampaign'; $__ar_affiliates__[$__index__] = 'http://wlplink.com/go/active-campaign'; $__ar_videotutorial__[$__index__] = wlm_video_tutorial('integration', 'ar', $__index__); if ($data['ARProvider'] == $__index__) { if ($__INTERFACE__) { $class_file = $this->pluginDir . '/extlib/active-campaign/active-campaign.php'; include $class_file; $ac = false; $lists = array(); if (!empty($data['activecampaign']['api_url']) && !empty($data['activecampaign']['api_key'])) { $ac = new WpActiveCampaign($data['activecampaign']['api_url'], $data['activecampaign']['api_key']); $lists = $ac->get_lists(); } ?> <form method="post"> <input type="hidden" name="saveAR" value="saveAR" /> <h2 class="wlm-integration-steps">Step 1: Enter your API Settings</h2> <p>You may obtain your API URL and Key by logging in to your ActiveCampaign account and going to "Your Settings"</p> <table class="form-table"> <tr> <th>API URL</th> <td><input size="50" type="text" name="ar[api_url]" value="<?php echo $data['activecampaign']['api_url']; ?> "/></td> </tr> <tr>