You are here

function _mailchimp_is_subscribed in Mailchimp 5

Same name and namespace in other branches
  1. 5.2 mailchimp.module \_mailchimp_is_subscribed()
  2. 6.2 mailchimp.module \_mailchimp_is_subscribed()
  3. 6 mailchimp.module \_mailchimp_is_subscribed()
  4. 7 mailchimp.module \_mailchimp_is_subscribed()

Check if the given user is subscribed to the given list

5 calls to _mailchimp_is_subscribed()
mailchimp_bio_nodeapi in ./mailchimp_bio.module
Implementation of hook_nodeapi(). Allows update on bio change
mailchimp_unsubscribe_form_validate in ./mailchimp.module
mailchimp_user in ./mailchimp.module
_mailchimp_subscribe_user in ./mailchimp.module
Subscribe the given user to the given list if he/she is not already subscribed
_mailchimp_unsubscribe_user in ./mailchimp.module
Unsubscribe the given user to the given list

File

./mailchimp.module, line 679

Code

function _mailchimp_is_subscribed($listid, $mail, $q = NULL) {
  $is_subscribed = false;
  if ($q || ($q = _mailchimp_get_api_object())) {
    $sub_info = $q
      ->listMemberInfo($listid, $mail);
    $is_subscribed = @$sub_info['status'] == 'subscribed';
  }
  return $is_subscribed;
}