You are here

public function SendinblueManager::getEmailTemplate in SendinBlue 8.2

Same name and namespace in other branches
  1. 8 src/SendinblueManager.php \Drupal\sendinblue\SendinblueManager::getEmailTemplate()

Get email template by type.

Parameters

string $type: A type of email.

Return value

array An array of email content.

1 call to SendinblueManager::getEmailTemplate()
SendinblueManager::sendEmail in src/SendinblueManager.php
Send mail.

File

src/SendinblueManager.php, line 426

Class

SendinblueManager
Basic manager of module.

Namespace

Drupal\sendinblue

Code

public function getEmailTemplate($type = 'test') {
  $file = 'temp';
  $file_path = drupal_get_path('module', 'sendinblue') . '/asset/email-templates/' . $type . '/';

  // Get html content.
  $html_content = file_get_contents($file_path . $file . '.html');

  // Get text content.
  $text_content = file_get_contents($file_path . $file . '.txt');
  $templates = [
    'html_content' => $html_content,
    'text_content' => $text_content,
  ];
  return $templates;
}