You are here

public function SendinblueApiV3::getTemplates in SendinBlue 8

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

Get templates.

Return value

\Drupal\sendinblue\Tools\Model\GetSmtpTemplates An array of campaigns.

Overrides SendInBlueApiInterface::getTemplates

File

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

Class

SendinblueApiV3
Sendinblue REST client.

Namespace

Drupal\sendinblue\Tools\Api

Code

public function getTemplates() {
  $templates = $this->sibTransactionalEmailsApi
    ->getSmtpTemplates();
  if ($templates && !empty($templates['templates'])) {
    return new GetSmtpTemplates(Json::decode($templates));
  }
  return [];
}