You are here

public function SendinblueApiV2::getTemplate in SendinBlue 8

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

Get template by id.

Parameters

string $id: A template identification.

Return value

\Drupal\sendinblue\Tools\Model\GetSmtpTemplateOverview A template.

Overrides SendInBlueApiInterface::getTemplate

File

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

Class

SendinblueApiV2
Sendinblue REST client.

Namespace

Drupal\sendinblue\Tools\Api

Code

public function getTemplate($id) {
  $templates = $this
    ->getTemplates();
  if ($templates) {
    foreach ($templates
      ->getTemplates() as $template) {
      if ($template
        ->getId() === $id) {
        return $template;
      }
    }
  }
  return NULL;
}