• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP MCAPI类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中MCAPI的典型用法代码示例。如果您正苦于以下问题:PHP MCAPI类的具体用法?PHP MCAPI怎么用?PHP MCAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了MCAPI类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getOptions

 /**
  * Method to get the field options.
  *
  * @return	array	The field option objects.
  * @since	1.6
  */
 protected function getOptions()
 {
     // Initialize variables.
     $options = array();
     $app = JFactory::getApplication();
     require_once JPATH_SITE . '/components/com_jms/helpers/MCAPI.class.php';
     require_once JPATH_SITE . '/components/com_jms/helpers/MCauth.php';
     $MCauth = new MCauth();
     // Get the component config/params object.
     $params = JComponentHelper::getParams('com_joomailermailchimpintegration');
     $paramsPrefix = version_compare(JVERSION, '1.6.0', 'ge') ? 'params.' : '';
     $api_key = $params->get($paramsPrefix . 'MCapi');
     if ($MCauth->MCauth()) {
         $api = new MCAPI($api_key);
         $retval = $api->lists();
         if (is_array($retval['data'])) {
             foreach ($retval['data'] as $list) {
                 $options[] = JHTML::_('select.option', $list['id'], JText::_($list['name']));
             }
         }
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:31,代码来源:listid.php


示例2: addAction

 public function addAction()
 {
     $api = new MCAPI($this->_apiKey);
     $email = $this->getRequest()->getParam('email');
     $retval = $api->lists();
     if ($api->errorCode) {
         Mage::getSingleton('core/session')->addError($this->__('Error: %s', $api->errorMessage));
     } else {
         /*foreach($retval['data'] as $val) {
               if ($val['name'] === "Prospects") {
                   $prospectListId = $val['id'];
               } elseif ($val['name'] === "Fashion Eyewear Customers") {
                   $customerListId = $val['id'];
               }
           }*/
         $customers = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*')->addAttributeToFilter('email', $email)->getData();
         $customerId = $customers[0]['entity_id'];
         $orders = Mage::getResourceModel('sales/order_collection')->addFieldToSelect('*')->addFieldToFilter('customer_id', $customerId)->getData();
         if (!empty($orders)) {
             //add to Customer List
             $listId = $this->customerListId;
         } else {
             //add to Prospect list
             $listId = $this->prospectListId;
         }
         $merge_vars = array('FNAME' => $this->getRequest()->getParam('firstname'));
         if ($api->listSubscribe($listId, $email, $merge_vars) === true) {
             Mage::getSingleton('core/session')->addSuccess($this->__('Success! Check your email to confirm sign up.'));
         } else {
             Mage::getSingleton('core/session')->addError($this->__('Error: %s', $api->errorMessage));
         }
     }
     $this->_redirectReferer();
 }
开发者ID:CherylMuniz,项目名称:fashion,代码行数:34,代码来源:MailchimpController.php


示例3: onSignup

 public function onSignup()
 {
     $settings = Settings::instance();
     if (!$settings->api_key) {
         throw new ApplicationException('MailChimp API key is not configured.');
     }
     /*
      * Validate input
      */
     $data = post();
     $rules = ['email' => 'required|email|min:2|max:64'];
     $validation = Validator::make($data, $rules);
     if ($validation->fails()) {
         throw new ValidationException($validation);
     }
     /*
      * Sign up to Mailchimp via the API
      */
     require_once plugins_path() . '/rainlab/mailchimp/vendor/MCAPI.class.php';
     $api = new \MCAPI($settings->api_key);
     $this->page['error'] = null;
     $mergeVars = '';
     if (isset($data['merge']) && is_array($data['merge']) && count($data['merge'])) {
         $mergeVars = $data['merge'];
     }
     if ($api->listSubscribe($this->property('list'), post('email'), $mergeVars) !== true) {
         $this->page['error'] = $api->errorMessage;
     }
 }
开发者ID:jhenahan,项目名称:mailchimp-plugin,代码行数:29,代码来源:Signup.php


示例4: mc_remove_email

function mc_remove_email($email_address)
{
    require_once DIR_WS_CLASSES . 'MCAPI.class.php';
    $api = new MCAPI(MAILCHIMP_API);
    $email = $newsletter['customers_email_address'];
    $retval = $api->listUnsubscribe(MAILCHIMP_ID, $email, MAILCHIMP_DELETE, MAILCHIMP_SEND_GOODBYE, MAILCHIMP_SEND_NOTIFY);
}
开发者ID:digideskio,项目名称:oscmax2,代码行数:7,代码来源:mailchimp_functions.php


示例5: mc_subscribe

 public function mc_subscribe()
 {
     $email = $this->input->get('email');
     if (!$email) {
         $data['response_type'] = 'error';
         $data['response'] = "No email address provided";
     }
     if (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\$/i", $email)) {
         $data['response_type'] = 'error';
         $data['response'] = "Email address is invalid.";
     } else {
         require_once 'includes/MCAPI.class.php';
         $api = new MCAPI('c008756fe177a689e69abf3c5e44a59f-us1');
         // grab your List's Unique Id by going to http://admin.mailchimp.com/lists/
         // Click the "settings" link for the list - the Unique Id is at the bottom of that page.
         $list_id = "4249f1e3e5";
         if ($api->listSubscribe($list_id, $email, '') === true) {
             // Success
             $data['response_type'] = 'success';
             $data['response'] = 'Success! Check your email to confirm sign up.';
             $data['goal_location'] = 'Home';
             //Where did they register? Answer = home page
             // Set cookie for 7 days (to not load reg panel for 7 days)
             $c = array('name' => 'close_mc_subscribe', 'value' => 'true', 'expire' => '604800');
             $this->input->set_cookie($c);
         } else {
             $data['response_type'] = 'error';
             $data['response'] = 'Error: ' . $api->errorMessage;
         }
     }
     $this->load->view('ajax/mc_subscribe', $data);
 }
开发者ID:nyalex,项目名称:Lavish-Frugal,代码行数:32,代码来源:ajax.php


示例6: save

 public function save()
 {
     if (!$_POST) {
         die;
     }
     $this->rsp = Response::instance();
     if (!valid::email($_POST['email'])) {
         $this->rsp->msg = 'Invalid Email!';
         $this->rsp->send();
     } elseif ($this->owner->unique_key_exists($_POST['email'])) {
         $this->rsp->msg = 'Email already exists!';
         $this->rsp->send();
     }
     $pw = text::random('alnum', 8);
     $this->owner->email = $_POST['email'];
     $this->owner->password = $pw;
     $this->owner->save();
     $replyto = 'unknown';
     $body = "Hi there, thanks for saving your progess over at http://pluspanda.com \r\n" . "Your auto-generated password is: {$pw} \r\n" . "Change your password to something more appropriate by going here:\r\n" . "http://pluspanda.com/admin/account?old={$pw} \r\n\n" . "Thank you! - Jade from pluspanda";
     # to do FIX THE HEADERS.
     $subject = 'Your Pluspanda account information =)';
     $headers = "From: [email protected] \r\n" . "Reply-To: Jade \r\n" . 'X-Mailer: PHP/' . phpversion();
     mail($_POST['email'], $subject, $body, $headers);
     # add to mailing list.
     include Kohana::find_file('vendor/mailchimp', 'MCAPI');
     $config = Kohana::config('mailchimp');
     $mailchimp = new MCAPI($config['apikey']);
     $mailchimp->listSubscribe($config['list_id'], $_POST['email'], '', 'text', FALSE, TRUE, TRUE, FALSE);
     $this->rsp->status = 'success';
     $this->rsp->msg = 'Thanks, Account Saved!';
     $this->rsp->send();
 }
开发者ID:plusjade,项目名称:pluspanda-php,代码行数:32,代码来源:account.php


示例7: storeAddress

function storeAddress($apikey, $listid)
{
    //    $your_apikey = '78a6118343c6bf1cdade80bb4162e0b3-us9';
    //    $my_list_unique_id = "e5cd1cb09f";
    $your_apikey = $apikey;
    $my_list_unique_id = $listid;
    // Validation
    if (!$_GET['email']) {
        return "No email address provided";
    }
    if (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\$/i", $_GET['email'])) {
        return "Email address is invalid!";
    }
    require_once 'MCAPI.class.php';
    // grab an API Key from http://admin.mailchimp.com/account/api/
    $api = new MCAPI($your_apikey);
    // grab your List's Unique Id by going to http://admin.mailchimp.com/lists/
    // Click the "settings" link for the list - the Unique Id is at the bottom of that page.
    $list_id = $my_list_unique_id;
    if ($api->listSubscribe($list_id, $_GET['email'], '') === true) {
        // It worked!
        return 'Success! Check your email to confirm.';
    } else {
        // An error ocurred, return error message
        return 'Error: ' . $api->errorMessage;
    }
}
开发者ID:q178015846,项目名称:yankee,代码行数:27,代码来源:store-address.php


示例8: mailChimp

function mailChimp($email, $api, $list_id, $messages)
{
    // Retrieve API key from: http://admin.mailchimp.com/account/api/
    $api = new MCAPI($api);
    if ($api->listSubscribe($list_id, $email, '') === true) {
        // Success!
        $status = 'success';
        $message = $messages[3];
    } else {
        if (empty($email)) {
            $status = "error";
            $message = $messages[0];
        } else {
            if (!preg_match('/^[^\\W][a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)*\\@[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)*\\.[a-zA-Z]{2,4}$/', $email)) {
                $status = "error";
                $message = $messages[1];
            } else {
                // An error ocurred, return error message
                $status = 'error';
                $message = $messages[4];
            }
        }
    }
    $data = array('status' => $status, 'message' => $message);
    echo json_encode($data);
    exit;
}
开发者ID:jonathanbe,项目名称:rmc,代码行数:27,代码来源:functions.php


示例9: storeAddress

function storeAddress()
{
    // Validation
    if (!$_GET['email']) {
        return "No email address provided";
    }
    if (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\$/i", $_GET['email'])) {
        return "Email address is invalid";
    }
    require_once 'MCAPI.class.php';
    // grab an API Key from http://admin.mailchimp.com/account/api/
    $api = new MCAPI('d7229a6dbbe5df2b5bb2f6430fdbefd4-us2');
    // grab your List's Unique Id by going to http://admin.mailchimp.com/lists/
    // Click the "settings" link for the list - the Unique Id is at the bottom of that page.
    $list_id = "97aad3ac02";
    // Merge variables are the names of all of the fields your mailing list accepts
    // Ex: first name is by default FNAME
    // You can define the names of each merge variable in Lists > click the desired list > list settings > Merge tags for personalization
    // Pass merge values to the API in an array as follows
    $mergeVars = array('FNAME' => $_GET['fname'], 'LNAME' => $_GET['lname'], 'ADDRESS' => $_GET['address'], 'CITY' => $_GET['city'], 'STATE' => $_GET['state'], 'ZIP' => $_GET['zip']);
    if ($api->listSubscribe($list_id, $_GET['email'], $mergeVars) === true) {
        // It worked!
        return 'Success! Check your email to confirm sign up.';
    } else {
        // An error ocurred, return error message
        return 'Error: ' . $api->errorMessage;
    }
}
开发者ID:brybrarobry13,项目名称:cari-toon,代码行数:28,代码来源:store-address.php


示例10: iron_mailchimp_subscribe

function iron_mailchimp_subscribe()
{
    require_once IRON_PARENT_DIR . '/includes/classes/MCAPI.class.php';
    $enabled = get_iron_option('newsletter_enabled');
    $mc_api_key = get_iron_option('mailchimp_api_key');
    $mc_list_id = get_iron_option('mailchimp_list_id');
    extract($_POST);
    if (!$enabled) {
        die('disabled');
    }
    if ($mc_api_key == '' || $mc_list_id == '') {
        die('missing_api_key');
    }
    // check if email is valid
    if (isset($email) && is_email($email)) {
        $api = new MCAPI($mc_api_key);
        if ($api->listSubscribe($mc_list_id, $email, '') === true) {
            die('success');
        } else {
            die('subscribed');
        }
    } else {
        die('invalid');
    }
}
开发者ID:hathbanger,项目名称:squab,代码行数:25,代码来源:functions.php


示例11: actionMailchimp

 public function actionMailchimp()
 {
     if (!isset($_POST['email']) || !$_POST['email']) {
         echo "No email provided";
         $this->redirect(array('/deal/search', 'notify' => 'no_email'));
     }
     if (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\$/i", $_POST['email'])) {
         echo "Email address is invalid";
         $this->redirect(array('/deal/search', 'notify' => 'invalid_email'));
     }
     Yii::import('pages.components.MailChimp.MCAPI');
     $path = Yii::getPathOfAlias('pages.components.MailChimp');
     require $path . '/MCAPI.php';
     // grab an API Key from http://admin.mailchimp.com/account/api/
     $api = new MCAPI('fa420eff49d20479854185e4432ee34f-us2');
     // grab your List's Unique Id by going to http://admin.mailchimp.com/lists/
     // Click the "settings" link for the list - the Unique Id is at the bottom of that page.
     $list_id = "d95db04d2d";
     if ($api->listSubscribe($list_id, $_POST['email'], '', 'html', false, false, true, true) === true) {
         // It worked!
         $this->redirect(array('/deal/search', 'notify' => 'success'));
     } else {
         // An error ocurred, return error message
         //echo $api->errorMessage;
         $this->redirect(array('/deal/search', 'notify' => 'api_error'));
     }
 }
开发者ID:sagittaros,项目名称:dealschrome,代码行数:27,代码来源:UtilitiesController.php


示例12: getList

 public static function getList($params = array())
 {
     require_once OSEMSC_B_LIB . DS . 'MCAPI.class.php';
     $oseMscConfig = oseRegistry::call('msc')->getConfig(null, 'obj');
     $APIKey = $oseMscConfig->mailchimp_api_key;
     $api = new MCAPI($APIKey);
     $lists = $api->lists();
     $data = $lists['data'];
     $items = array();
     $item = array();
     foreach ($data as $value) {
         $item['list_id'] = $value['id'];
         $item['name'] = $value['name'];
         $items[] = $item;
     }
     $result = array();
     if (count($items) < 1) {
         $result['total'] = 0;
         $result['results'] = '';
     } else {
         $result['total'] = count($items);
         $result['results'] = $items;
     }
     return $result;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:25,代码来源:panel.mailchimp.php


示例13: getCMSFields

 public function getCMSFields()
 {
     $fieldBody = new TextareaField('Body', 'Inhoud');
     $fieldBody->setRows(5);
     $oFields = new FieldList(new TextField('Header', 'Title'), $fieldBody, new TextField('FieldLabelName', 'Dummy text in name field'), new TextField('FieldLabelEmail', 'Dummy text in email field'), new TextField('BtnLabel', 'Button label'));
     if (Config::inst()->get(NewsLetterWidget_Name, NewsLetterWidget_Storage_Sys) == NewsLetterWidget_Storage_Sys_Mailchimp) {
         $fldTextFieldListId = new TextField('MailChimpListID', 'Mailchimp lijst id');
         $sApiKey = Config::inst()->get(NewsLetterWidget_Name, NewsLetterWidget_Storage_Sys_Mailchimp_APIKey);
         if ($sApiKey == null || trim($sApiKey) == '') {
             $oFields->push($fldTextFieldListId);
         } else {
             // fetch lists
             $api = new MCAPI($sApiKey);
             $retval = $api->lists();
             if ($api->errorCode) {
                 //echo "Unable to load lists()!";
                 //echo "\n\tCode=".$api->errorCode;
                 //echo "\n\tMsg=".$api->errorMessage."\n";
             } else {
                 //echo "Lists that matched:".$retval['total']."\n";
                 //echo "Lists returned:".sizeof($retval['data'])."\n";
                 $aOptions = array();
                 foreach ($retval['data'] as $list) {
                     //echo "Id = ".$list['id']." - ".$list['name']."\n";
                     //echo "Web_id = ".$list['web_id']."\n";
                     $aOptions[$list['id']] = $list['name'];
                 }
                 $oFields->push(new DropdownField('MailChimpListID', 'Mailchimp lijst id', $aOptions));
             }
         }
     }
     return $oFields;
 }
开发者ID:hamaka,项目名称:hamaka-widgets,代码行数:33,代码来源:NewsletterWidget.php


示例14: storeAddress

/**
* store address to mailchimp mailing list
* IMPORTANT : 
- Replace 'YOUR_APIKEY_HERE' by your api key from your mailchimp
    Get one here http://admin.mailchimp.com/account/api/
- Replace 'YOUR_LISTID_HERE' by your list's unique ID
   Create a list here http://admin.mailchimp.com/lists/
   Then Click the "settings" link for the list - the Unique Id is at the bottom of that page. 
*/
function storeAddress($user_email)
{
    $m_response = array();
    // Validation
    if (!$user_email) {
        $m_response['error'] = "No email address provided";
        return $m_response;
    }
    if (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\$/i", $user_email)) {
        $m_response['error'] = "Email address is invalid";
        return $m_response;
    }
    require_once 'MCAPI.class.php';
    // grab an API Key from http://admin.mailchimp.com/account/api/
    $api = new MCAPI('YOUR_APIKEY_HERE');
    // grab your List's Unique Id by going to http://admin.mailchimp.com/lists/
    // Click the "settings" link for the list - the Unique Id is at the bottom of that page.
    $list_id = "YOUR_LISTID_HERE";
    if ($api->listSubscribe($list_id, $user_email, '') === true) {
        // It worked!
        $m_response['success'] = 'You will be notified';
        //return 'Success! Check your email to confirm sign up.';
    } else {
        // An error ocurred, return error message
        $m_response['error'] = 'Error: Something went wrong' . $api->errorMessage;
        //return 'Error: ' . $api->errorMessage;
    }
    return $m_response;
}
开发者ID:bolvarak,项目名称:TuxNS,代码行数:38,代码来源:servermailchimp.php


示例15: autoresponder

 function autoresponder($plan, $user)
 {
     $plan_mc_listid = $plan->plan_mc_listid;
     $plan_mc_groupid = $plan->plan_mc_groupid;
     $name = $user->get('name');
     $email = $user->get('email');
     $explodename = explode(' ', "{$name} ");
     $fname = $explodename[0];
     $lname = $explodename[1];
     $merge_vars = array('FNAME' => $fname, 'LNAME' => $lname, 'INTERESTS' => $plan_mc_groupid);
     require_once JPATH_COMPONENT . '/helpers/MCAPI.class.php';
     // Get the component config/params object.
     $params = JComponentHelper::getParams('com_joomailermailchimpintegration');
     $paramsPrefix = version_compare(JVERSION, '1.6.0', 'ge') ? 'params.' : '';
     $api_key = $params->get($paramsPrefix . 'MCapi');
     $api = new MCAPI($api_key);
     $api->listSubscribe($plan_mc_listid, $email, $merge_vars);
     // check for duplicates
     $db =& JFactory::getDBO();
     $sql = 'SELECT COUNT(*)' . ' FROM #__joomailermailchimpintegration' . ' WHERE email = "' . $email . '" AND listid = "' . $plan_mc_listid . '"';
     $db->setQuery($sql);
     $count = $db->loadResult();
     if ($count == 0) {
         // add to joomailermailchimpintegration DB
         $sql = 'INSERT INTO #__joomailermailchimpintegration' . ' VALUES ("",' . $user->get('id') . ',"' . $email . '","' . $plan_mc_listid . '")';
         $db->setQuery($sql);
         $db->query();
     }
     //joomailermailchimpintegration DB
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:30,代码来源:iwl_mailchimp.php


示例16: oxy_sign_up

function oxy_sign_up()
{
    if (isset($_POST['nonce'])) {
        if (wp_verify_nonce($_POST['nonce'], 'oxygenna-sign-me-up-nonce')) {
            header('Content-Type: application/json');
            $resp = new stdClass();
            $user_email = $_POST['email'];
            $resp->email = $user_email;
            if (filter_var($user_email, FILTER_VALIDATE_EMAIL) !== false) {
                //create the API from the stored key
                $api = new MCAPI(oxy_get_option('api_key'));
                // The list the user will subscribe to
                $list_id = oxy_get_option('list_id');
                $api->listSubscribe($list_id, $user_email);
                if ($api->errorCode) {
                    $resp->status = 'error';
                    $resp->message = __('Error registering', THEME_FRONT_TD);
                } else {
                    $resp->status = 'ok';
                    $resp->message = __('Registered', THEME_FRONT_TD);
                }
            } else {
                $resp->status = 'error';
                $resp->message = __('Invalid email', THEME_FRONT_TD);
            }
            echo json_encode($resp);
            die;
        }
    }
}
开发者ID:vanie3,项目名称:appland,代码行数:30,代码来源:mailchimp.php


示例17: sendMailchimp

function sendMailchimp($formData)
{
    $api = new MCAPI(MAILCHIMP_API_KEY);
    if ($api->listSubscribe(MAILCHIMP_LIST_ID, $formData['newsletter-email'], '') === true) {
        return true;
    } else {
        return $api->errorMessage;
    }
}
开发者ID:KosDm,项目名称:hydraukr,代码行数:9,代码来源:newsletter.php


示例18: __trigger

 protected function __trigger()
 {
     $email = $_POST['email'];
     $merge = $_POST['merge'];
     $result = new XMLElement("mailchimp");
     $api = new MCAPI($this->_driver->getUser(), $this->_driver->getPass());
     $cookies = new XMLElement("cookies");
     foreach ($merge as $key => $val) {
         if (!empty($val)) {
             $cookie = new XMLElement('cookie', $val);
             $cookie->setAttribute("handle", $key);
             $cookies->appendChild($cookie);
         }
     }
     $cookie = new XMLElement('cookie', $email);
     $cookie->setAttribute("handle", 'email');
     $cookies->appendChild($cookie);
     $result->appendChild($cookies);
     if ($merge['fname'] == '') {
         $error = new XMLElement('error', 'First name is required.');
         $error->setAttribute("handle", 'fname');
         $result->appendChild($error);
         $result->setAttribute("result", "error");
         return $result;
     }
     if ($merge['lname'] == '') {
         $error = new XMLElement('error', 'Last name is required.');
         $error->setAttribute("handle", 'lname');
         $result->appendChild($error);
         $result->setAttribute("result", "error");
         return $result;
     }
     if ($email == '') {
         $error = new XMLElement('error', 'E-mail is required.');
         $error->setAttribute("handle", 'email');
         $result->appendChild($error);
         $result->setAttribute("result", "error");
         return $result;
     }
     if (!ereg('^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$', $email)) {
         $error = new XMLElement('error', 'E-mail is invalid.');
         $error->setAttribute("handle", 'email');
         $result->appendChild($error);
         $result->setAttribute("result", "error");
         return $result;
     }
     if (!$api->listSubscribe($this->_driver->getList(), $email, array_change_key_case($merge, CASE_UPPER))) {
         $result->setAttribute("result", "error");
         $error = new XMLElement("error", $api->errorMessage);
         $result->appendChild($error);
     } else {
         $result->setAttribute("result", "success");
     }
     return $result;
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:55,代码来源:event.mailchimp.php


示例19: storeAddress

function storeAddress()
{
    $getmailchimp = mysql_query("select api_key, list_id from idevaff_newsletter_mailchimp");
    $getmailchimp = mysql_fetch_array($getmailchimp);
    $mailchimp_key = $getmailchimp['api_key'];
    $mailchimp_listid = $getmailchimp['list_id'];
    require_once 'MCAPI.class.php';
    $api = new MCAPI($mailchimp_key);
    $mergeVars = array('FNAME' => quote_smart($_POST['f_name']), 'LNAME' => quote_smart($_POST['l_name']));
    $api->listSubscribe($mailchimp_listid, quote_smart($_POST['email']), $mergeVars);
}
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:11,代码来源:mailchimp_signup.php


示例20: sendMailChimp

function sendMailChimp($mailSubscribe)
{
    if (defined('MC_APIKEY') && defined('MC_LISTID')) {
        $api = new MCAPI(MC_APIKEY);
        if ($api->listSubscribe(MC_LISTID, $mailSubscribe) !== true) {
            if ($api->errorCode == 214) {
                throw new Exception("Email exist", 2);
            } else {
                errorLog("MailChimp", "[" . $api->errorCode . "] " . $api->errorMessage);
            }
        }
    }
}
开发者ID:johnmrobinson,项目名称:johnmrobinson.github.io,代码行数:13,代码来源:subscribe.php



注:本文中的MCAPI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP MD5Crypt类代码示例发布时间:2022-05-23
下一篇:
PHP MAX类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap