You are here

function htmlmail_get_selected_theme in HTML Mail 7.2

Same name and namespace in other branches
  1. 8.2 htmlmail.module \htmlmail_get_selected_theme()
  2. 6.2 htmlmail.module \htmlmail_get_selected_theme()
  3. 7 htmlmail.module \htmlmail_get_selected_theme()

Returns the selected theme to use for outgoing emails.

Parameters

array $message: (optional) The message to be themed.

Return value

string The 'theme' key of $message if set and allowed, empty string otherwise.

3 calls to htmlmail_get_selected_theme()
HTMLMailSystem::format in ./htmlmail.mail.inc
Format emails according to module settings.
htmlmail_theme in ./htmlmail.module
Implements hook_theme().
template_preprocess_htmlmail in ./htmlmail.module
Process variables to format email messages.

File

./htmlmail.module, line 224
Sends system emails in HTML.

Code

function htmlmail_get_selected_theme(&$message = array()) {
  $selected = isset($message['theme']) ? $message['theme'] : variable_get('htmlmail_theme', '');
  if ($selected) {

    // Make sure the selected theme is allowed.
    $themes =& htmlmail_get_allowed_themes();
    if (empty($themes[$selected])) {
      $selected = '';
    }
  }
  return $selected;
}