You are here

public static function HtmlMailHelper::getThemeNames in HTML Mail 8.3

Same name and namespace in other branches
  1. 8 src/Helper/HtmlMailHelper.php \Drupal\htmlmail\Helper\HtmlMailHelper::getThemeNames()

Retrieves the theme names based on module and key.

Parameters

array $message: The message array with module name and key.

Return value

array An array with themes name.

2 calls to HtmlMailHelper::getThemeNames()
HtmlMailSystem::format in src/Plugin/Mail/HtmlMailSystem.php
Format emails according to module settings.
HtmlMailSystem::formatMailMime in src/Plugin/Mail/HtmlMailSystem.php
Use the MailMime class to format the message body.

File

src/Helper/HtmlMailHelper.php, line 123

Class

HtmlMailHelper
Class HtmlMailHelper.

Namespace

Drupal\htmlmail\Helper

Code

public static function getThemeNames(array $message) {
  $formatted_module = str_replace('_', '-', $message['module']);
  $formatted_key = str_replace('_', '-', $message['key']);
  return [
    'htmlmail__' . $formatted_module,
    'htmlmail__' . $formatted_module . '__' . $formatted_key,
    'htmlmail',
  ];
}