console.log('$string');";
return;
}
function process_actions_stacks_in_351_page48($action, $email, $first_name="", $last_name="", $custom="", $customtwo="") {
if($action === 'export' or filter_var($email, FILTER_VALIDATE_EMAIL)) {
require_once('files/postoffice-lib/MCAPI.class.php');
$api = new MCAPI('49f1e2943ac738983b27c4c55fbc005a-us5');
switch ($action) {
case 'add':
$merge_vars = array('FNAME'=>$first_name, 'LNAME'=>$last_name, 'CUSTOM'=>$custom, 'CUSTOMTWO'=>$customtwo);
$retval = $api->listSubscribe('5f49cdc9a4', $email, $merge_vars);
if ($api->errorCode){
log_message_stacks_in_351_page48("MailChimp API Error: (".$api->errorCode.") ".$api->errorMessage);
}
break;
case 'remove':
$retval = $api->listUnsubscribe('5f49cdc9a4',$email);
if ($api->errorCode){
log_message_stacks_in_351_page48("MailChimp API Error: (".$api->errorCode.") ".$api->errorMessage);
}
break;
default:
break;
}
/*
*/
}
return;
}
// Process Requests
if ( isset($_POST['action']) ) {
$email = isset($_POST['email']) ? $_POST['email'] : '';
$first_name = isset($_POST['first_name']) ? $_POST['first_name'] : '';
$last_name = isset($_POST['last_name']) ? $_POST['last_name'] : '';
$custom = isset($_POST['custom']) ? $_POST['custom'] : '';
$customtwo = isset($_POST['customtwo']) ? $_POST['customtwo'] : '';
if (preg_match('/^changeme\@export\.csv$/', $email)) {
process_actions_stacks_in_351_page48('export', $email, $first_name, $last_name, $custom, $customtwo);
}
process_actions_stacks_in_351_page48($_POST['action'], $email, $first_name, $last_name, $custom, $customtwo);
}
elseif ( isset($_GET['action']) ) {
$email = isset($_GET['email']) ? $_GET['email'] : '';
$first_name = isset($_GET['first_name']) ? $_GET['first_name'] : '';
$last_name = isset($_GET['last_name']) ? $_GET['last_name'] : '';
$custom = isset($_GET['custom']) ? $_GET['custom'] : '';
$customtwo = isset($_GET['customtwo']) ? $_GET['customtwo'] : '';
process_actions_stacks_in_351_page48($_GET['action'], $email, $first_name, $last_name, $custom, $customtwo);
}
?>