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()); } }