You are here

function document_mail_text in Document 7

Same name and namespace in other branches
  1. 6 document.inc \document_mail_text()
  2. 8.x document.inc \document_mail_text()
2 calls to document_mail_text()
document_mail in ./document.module
Implementation of hook_mail().
document_settings_form in ./document.admin.inc

File

./document.inc, line 272

Code

function document_mail_text($key, $language = NULL, $variables = array()) {
  $langcode = isset($language) ? $language->language : NULL;
  if ($admin_setting = variable_get('document_' . $key, FALSE)) {

    // An admin setting overrides the default string.
    return strtr($admin_setting, $variables);
  }
  else {

    // No override, return default string.
    switch ($key) {
      case 'publish_subject':
        return t('Your Document got published at !site', $variables, array(
          'langcode' => $langcode,
        ));
      case 'publish_body':
        return t("!username,\n\nThank you for uploading a document at !site. Your document, \"!node_title\" has been published by the moderators. You can now view your document at: !node_title_link.\n\n\n--  !site team", $variables, array(
          'langcode' => $langcode,
        ));
    }
  }
}