You are here

public function SendinblueApiV2::getSmtpDetails in SendinBlue 8

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

Get the details of smtp.

Return value

\Drupal\sendinblue\Tools\Model\GetSmtpDetails|null A smtp details.

Overrides SendInBlueApiInterface::getSmtpDetails

File

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

Class

SendinblueApiV2
Sendinblue REST client.

Namespace

Drupal\sendinblue\Tools\Api

Code

public function getSmtpDetails() {
  $smtpDetails = $this->sIBHttpClient
    ->get("account/smtpdetail", "");
  if ($smtpDetails) {
    $sibSmtpDetails = $smtpDetails['data']['relay_data']['data'];
    $enabled = $smtpDetails['data']['relay_data']['status'] === 'enabled';
    return new GetSmtpDetails($sibSmtpDetails['username'], $sibSmtpDetails['relay'], $sibSmtpDetails['port'], $enabled);
  }
  return null;
}