You are here

public static function SendinblueManager::getEmailTemplate in SendinBlue 7.2

Same name and namespace in other branches
  1. 7 includes/sendinblue.manage.inc \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 includes/sendinblue.manage.inc
Send mail.

File

includes/sendinblue.manage.inc, line 218
Manage class file.

Class

SendinblueManager
Basic manager of module.

Code

public static 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 = array(
    'html_content' => $html_content,
    'text_content' => $text_content,
  );
  return $templates;
}