You are here

protected function MailchimpListsSelectWidget::GetMemberStatus in Mailchimp 2.x

Parameters

$instance:

$email:

Return value

mixed

3 calls to MailchimpListsSelectWidget::GetMemberStatus()
MailchimpListsSelectWidget::setupSubscribeCheckbox in modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php
MailchimpListsSelectWidget::setupSubscriptionPendingMessage in modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php
MailchimpListsSelectWidget::setupUnsubscribeCheckbox in modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php

File

modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php, line 270

Class

MailchimpListsSelectWidget
Plugin implementation of the 'mailchimp_lists_select' widget.

Namespace

Drupal\mailchimp_lists\Plugin\Field\FieldWidget

Code

protected function GetMemberStatus($instance, $email) {
  $memberStatus = NULL;
  if (!empty($instance
    ->getEntity()) && $email) {
    $instance_list_id = $instance
      ->getFieldDefinition()
      ->getSetting('mc_list_id');
    $memberinfo = mailchimp_get_memberinfo($instance_list_id, $email, TRUE);
    if (isset($memberinfo->status)) {
      $memberStatus = $memberinfo->status;
    }
  }
  return $memberStatus;
}