You are here

protected function MailchimpListsSelectWidget::memberIsUnsubscribed in Mailchimp 2.x

Parameters

$mailchimp_list_id:

$email:

Return value

bool

2 calls to MailchimpListsSelectWidget::memberIsUnsubscribed()
MailchimpListsSelectWidget::setupInterestGroups in modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php
MailchimpListsSelectWidget::subscribeCheckboxShown in modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php

File

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

Class

MailchimpListsSelectWidget
Plugin implementation of the 'mailchimp_lists_select' widget.

Namespace

Drupal\mailchimp_lists\Plugin\Field\FieldWidget

Code

protected function memberIsUnsubscribed($mailchimp_list_id, $email) : bool {
  $member_info = mailchimp_get_memberinfo($mailchimp_list_id, $email);
  return !isset($member_info->status) || $member_info->status !== "unsubscribed";
}