public function madmimi_subscribe($that, $ar, $wpm_id, $email, $unsub = false) { $options = $that->GetOption('Autoresponders'); $maps = $options['madmimi']['maps'][$wpm_id]; if (empty($maps)) { return; } $username = $options['madmimi']['username']; $api_key = $options['madmimi']['api_key']; $mmm = new WPMadmimi($username, $api_key); try { if (!empty($maps)) { if ($unsub && $options['madmimi'][$wpm_id]['autoremove']) { $mmm->remove_from_lists($maps, $email); } if (!$unsub) { $mmm->add_to_lists($maps, $that->ARSender['email']); } } } catch (Exception $e) { error_log($e->getMessage()); } }
<?php $__index__ = 'madmimi'; $__ar_options__[$__index__] = 'Mad Mimi'; $__ar_affiliates__[$__index__] = 'http://wlplink.com/go/madmimi'; $__ar_videotutorial__[$__index__] = wlm_video_tutorial('integration', 'ar', $__index__); if ($data['ARProvider'] == $__index__) { if ($__INTERFACE__) { $class_file = $this->pluginDir . '/extlib/madmimi/madmimi.php'; include $class_file; $mmm = false; $lists = array(); if (!empty($data['madmimi']['username']) && !empty($data['madmimi']['api_key'])) { $mmm = new WPMadmimi($data['madmimi']['username'], $data['madmimi']['api_key']); $lists = $mmm->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 Mad Mimi account and going to "Account" » "API"</p> <table class="form-table"> <tr> <th>Username/Email</th> <td><input size="50" type="text" name="ar[username]" value="<?php echo $data['madmimi']['username']; ?> "/></td> </tr> <tr>