You are here

public function SendinblueApiV2::getList in SendinBlue 8

Same name and namespace in other branches
  1. 8.2 src/Tools/Api/SendinblueApiV2.php \Drupal\sendinblue\Tools\Api\SendinblueApiV2::getList()

Get list by id.

Parameters

string $id: A list identification.

Return value

\Drupal\sendinblue\Tools\Model\GetExtendedList An array of lists.

Overrides SendInBlueApiInterface::getList

File

src/Tools/Api/SendinblueApiV2.php, line 173

Class

SendinblueApiV2
Sendinblue REST client.

Namespace

Drupal\sendinblue\Tools\Api

Code

public function getList($id) {
  $list = $this->sIBHttpClient
    ->get("list/" . $id, "");
  return new GetExtendedList([
    'id' => $list['data']['id'],
    'name' => $list['data']['name'],
    'totalSubscribers' => $list['data']['total_subscribers'],
    'totalBlacklisted' => $list['data']['total_blacklisted'],
    'createdAt' => $list['data']['entered'],
    'folderId' => $list['data']['list_parent'],
    'dynamicList' => $list['data']['dynamic_list'],
  ]);
}