You are here

function mailchimp_subscribe in Mailchimp 7.4

Same name and namespace in other branches
  1. 8 mailchimp.module \mailchimp_subscribe()
  2. 7.5 mailchimp.module \mailchimp_subscribe()
  3. 7.3 mailchimp.module \mailchimp_subscribe()
  4. 2.x mailchimp.module \mailchimp_subscribe()

Subscribe a user to a Mailchimp list in real time or by adding to the queue.

Return value

bool True on success.

See also

Mailchimp_Lists::subscribe()

3 calls to mailchimp_subscribe()
MailchimpListsTestCase::testSubscribe in modules/mailchimp_lists/tests/mailchimp_lists.test
Tests subscribing a member to a list.
mailchimp_lists_process_subscribe_form_choices in modules/mailchimp_lists/mailchimp_lists.module
Processor for various list form submissions.
mailchimp_signup_subscribe_form_submit in modules/mailchimp_signup/mailchimp_signup.module
Submit handler to add users to lists on subscription form submission.

File

./mailchimp.module, line 563
Mailchimp module.

Code

function mailchimp_subscribe($list_id, $email, $merge_vars = NULL, $interests = array(), $double_optin = FALSE, $format = 'html') {
  if (variable_get('mailchimp_cron', FALSE)) {
    $args = array(
      'list_id' => $list_id,
      'email' => $email,
      'merge_vars' => $merge_vars,
      'interests' => $interests,
      'double_optin' => $double_optin,
      'format' => $format,
    );
    return mailchimp_addto_queue('mailchimp_subscribe_process', $args);
  }
  return mailchimp_subscribe_process($list_id, $email, $merge_vars, $interests, $double_optin, $format);
}