| @@ -13,9 +13,9 @@ | ||
| 13 | 13 | /** |
| 14 | 14 | * GetResponse Class |
| 15 | 15 | * @package GetResponsePHP |
| 16 | 16 | */ |
| 17 | -class GetResponseApi | |
| 17 | +class GetResponseApiOptinCat | |
| 18 | 18 | { |
| 19 | 19 | /** |
| 20 | 20 | * GetResponse API key |
| 21 | 21 | * http://www.getresponse.com/my_api_key.html |
| @@ -479,10 +479,15 @@ | ||
| 479 | 479 | $ip = $_SERVER['REMOTE_ADDR']; |
| 480 | 480 | |
| 481 | 481 | if (!$this->isValidIP($ip)) $ip = '127.0.0.1'; |
| 482 | 482 | |
| 483 | - $params = array('campaign' => $campaign, 'action' => $action, 'name' => $name, | |
| 483 | + $params = array('campaign' => $campaign, 'action' => $action, | |
| 484 | 484 | 'email' => $email, 'cycle_day' => $cycle_day, 'ip' => $ip); |
| 485 | + | |
| 486 | + if(!empty($name)) { | |
| 487 | + $params['name'] = $name; | |
| 488 | + } | |
| 489 | + | |
| 485 | 490 | if(!empty($customs)) { |
| 486 | 491 | foreach($customs as $key => $val) $c[] = array('name' => $key, 'content' => $val); |
| 487 | 492 | $params['customs'] = $c; |
| 488 | 493 | } |
| @@ -586,9 +591,9 @@ | ||
| 586 | 591 | $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); |
| 587 | 592 | if(!(($httpCode == '200') || ($httpCode == '204'))) trigger_error('API call failed. Server returned status code '.$httpCode, E_USER_ERROR); |
| 588 | 593 | curl_close($handle); |
| 589 | 594 | |
| 590 | - if ($response->error && defined ( 'FCA_EOI_DEBUG' ) ) { | |
| 595 | + if ($response->error && FCA_EOI_DEBUG ) { | |
| 591 | 596 | echo 'Whoops, something is broken: <br>'; |
| 592 | 597 | echo '<h2>'.$response->error->message.'</h2>'; |
| 593 | 598 | wp_die(); |
| 594 | 599 | } |