You are here

public function SendinblueApiV3::getUser in SendinBlue 8.2

Same name and namespace in other branches
  1. 8 src/Tools/Api/SendinblueApiV3.php \Drupal\sendinblue\Tools\Api\SendinblueApiV3::getUser()

Get user by email.

Parameters

string $email: An email address.

Return value

\Drupal\sendinblue\Tools\Model\GetExtendedContactDetails An array of response code.

Overrides SendInBlueApiInterface::getUser

1 call to SendinblueApiV3::getUser()
SendinblueApiV3::createUpdateUser in src/Tools/Api/SendinblueApiV3.php
Create and update user.

File

src/Tools/Api/SendinblueApiV3.php, line 287

Class

SendinblueApiV3
Sendinblue REST client.

Namespace

Drupal\sendinblue\Tools\Api

Code

public function getUser($email) {
  try {
    $contactInfo = $this->sibContactsApi
      ->getContactInfo($email);
    return new GetExtendedContactDetails(Json::decode($contactInfo));
  } catch (\Throwable $e) {
    return NULL;
  }
}